Question : print using dbms_output.put_line while triggers get executed

I have a web application in JSP with Oracle 8i as database. I have a few triggers in Oracle which contain dbms_output.put_line to print values on the SQL*Plus Interface(used for debugging). When the user performs an action in the application and the trigger or procedure gets executed I want that the  dbms_output.put_line statement in that trigger or procedure prints on the SQL*Plus Interface.
Normally when i exceute procedure or trigger in SQL*Plus interface values are printed but not when they execute in the background as a result of operations performed by the user.

Answer : print using dbms_output.put_line while triggers get executed

Hi,

DBMS_OUTPUT is used in SQLPLUS only for debugging purposes. If u want to debug the trigger from ur application what u can do is follows:

Create a table LOGTABLE which would keep history of actions taken

Inside yr trigger, instead of dumping o/p using DBMS_OUTPUT,insert a record in LOGTABLE using status messages, datetime ( ... whatever yr need might be )..

Later on u can always refer to this table to chek the log...

BUT DO MAKE SURE U PURGE THIS TABLE PERIODICALLY AS THIS TABLE CAN BE MASSIVE IN TERMS OF NUMBER OF RECORDS.

Rgds,
NHM
Random Solutions  
 
programming4us programming4us