Subject | RE: [firebird-support] Printing messages |
---|---|
Author | Nigel Weeks |
Post date | 2003-12-17T23:10:05Z |
I create a logging table, to which I insert statements about steps in the
procedure I'm writing.
Of course, it gets rolled back if the procedure fails, but it's handy for
logging data handling. Just concatenate fields, and insert them into one
varchar field:
Insert into tbl_trace(str_trace) values ('INS_SALE_TRANS: Qty
is'||:flt_quantity||', amount is'||:flt_amount||'.');
The other method I use is to create an exception, i.e:
create exception ex_stoppoint 'StopPoint has been reached';
and deliberately make the procedure break in different points as I
fault-find.
If a procedure is raising an exception of it's own(due to a programming
error/data mishandling), progressively move your new 'StopPoint' exception
down from the top of your procedure, until the message changes back to the
error one.
Sure, it's tedious, but exceptions roll back the entire transaction, so
nothing gets hurt in the process.
If you need an example, I can produce one.
N.
procedure I'm writing.
Of course, it gets rolled back if the procedure fails, but it's handy for
logging data handling. Just concatenate fields, and insert them into one
varchar field:
Insert into tbl_trace(str_trace) values ('INS_SALE_TRANS: Qty
is'||:flt_quantity||', amount is'||:flt_amount||'.');
The other method I use is to create an exception, i.e:
create exception ex_stoppoint 'StopPoint has been reached';
and deliberately make the procedure break in different points as I
fault-find.
If a procedure is raising an exception of it's own(due to a programming
error/data mishandling), progressively move your new 'StopPoint' exception
down from the top of your procedure, until the message changes back to the
error one.
Sure, it's tedious, but exceptions roll back the entire transaction, so
nothing gets hurt in the process.
If you need an example, I can produce one.
N.
> -----Original Message-----
> From: spam_eater@... [mailto:spam_eater@...]
> Sent: Thursday, 18 December 2003 09:47
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Printing messages
>
>
> Hello,
>
> does Firebird (1.5) support something similar to Oracle's
> dbms_output() or MS SQL Server's PRINT statement?
>
> For those who don't know either of those features: they enable e.g. a
> stored procedure/trigger to "print" messages during execution. MS SQL
> Server's Query Analyzer displays those messages when a procedure is
> executed. Very handy for debugging and logging. Postgres offers
> something similar with the RAISE keyword.
>
> In all cases these messages can be retrieved through JDBC after a call
> to a procedure, and I'd like to do something similar with Firebird
>
>
> Cheers
> Thomas
>
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
> Printer at MyInks.com. Free s/h on orders $50 or more to the
> US & Canada.
> http://www.c1tracking.com/l.asp?cid=5511
> http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/67folB/TM
> --------------------------------------------------------------
> -------~->
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>