Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Q:Debug Trigger or where dbms_output.putline

Re: Q:Debug Trigger or where dbms_output.putline

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Fri, 30 May 2003 20:50:39 GMT
Message-ID: <MPG.194163f79a85732f98979c@news.la.sbcglobal.net>


ralf.bender_at_arcor.de said...
>
> Hi
>
> is there someone who can tell a good way to debug a trigger? And how or
> where can I select the last informations from writing with
> dbms_output.putline?
>
> Thx for helping
>

When I debug a trigger, I usually create a transient "debug" table (don't want to say it's a "temporary" table because that conjures up all kinds of false ideas). The table has the columns I'm interested in plus a text field (say varchar2(100)) where I can put debug text. Add an appropriate INSERT statement in the trigger to populate my debug table, then sit back and wait for the trigger to fire several times. Then query the debug table from sqlplus. When I've figured out what's wrong, take the debug stuff out of the trigger and drop the debug table.

This is, for me at least, easier than trying to coax debugging info out of dbms_output.put_line statements (especially since put_line "display lines" are limited to 255 chars). And everything stays on the server, so I don't have to have a session open while the trigger is filling my table.

-- 
/Karsten
DBA > retired > DBA
Received on Fri May 30 2003 - 15:50:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US