PROCEDURE A as stack_info VARCHAR2(4096); BEGIN lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('Start-B -'||lv_time); B; lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('End-B -'||lv_time); EXCEPTION WHEN OTHERS THEN stack_info:=DBMS_UTILITY.FORMAT_CALL_STACK; dbms_output.put_line(stack_info); END; ----------------- PROCEDURE B as stack_info VARCHAR2(4096); BEGIN lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('Start-C -'||lv_time); C; lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('End-C -'||lv_time); EXCEPTION WHEN OTHERS THEN stack_info:=DBMS_UTILITY.FORMAT_CALL_STACK; dbms_output.put_line(stack_info); END; ---------------------- PROCEDURE C as stack_info VARCHAR2(4096); i NUMBER :=0; BEGIN -- Division By Zero will Rise INSERT INTO ttt VALUES(7/0);
EXCEPTION WHEN OTHERS THEN stack_info:=DBMS_UTILITY.FORMAT_CALL_STACK; dbms_output.put_line(stack_info); - The error code _The errormessage dbms_output.put_line(TO_CHAR(SQLCODE)||'-'||SQLERRM); END; ------------------------ - pick out the name of the procedure that is currently running, - pick out the start_time of the procedure - pick out the end_time of the procedure This eg. will do Above Question. set serveroutput on BEGIN lv_time varchar2(60); DECLARE BEGIN -- Procedure A Start Time lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('Start- A -'||lv_time); A lv_time:=lv_time:= to_char(sysdate,'DD/MON/YYYY HH:MI:SS AM'); dbms_output.put_line('End- A -'||lv_time); -- Procedure A Start Time END; END; ----------------- CREATE TABLE ttt ( f1 NUMBER ) Nitheesh -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Pullikol Kumar INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).