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: Identifying problem SQL statements

Re: Identifying problem SQL statements

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 28 Jan 1999 09:49:26 -0000
Message-ID: <917517005.28686.0.nnrp-08.9e984b29@news.demon.co.uk>


A very simple minded approach which might be sufficient for your needs would be to declare a variable at the head of the program, then set it to a value that is unique to the SQL statement you are about to run. Then your single exception need only output the value of the variable to tell you where the thing broke. (You might want to have both and 'entering SQL statement X' and 'completed SQl statement X' in case the code breaks between statements).

Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk

lofftjm_at_itec.suny.edu wrote in message <78ohv1$5ug$1_at_nnrp1.dejanews.com>...
>I have a PL/SQL procedure that includes many insert and update
>statements. Instead of performing exception handling for each
>specific statement, is it possible to have a single WHEN OTHERS
>exception that will then show the SQL statement that caused the
>problem?
>
>I have looked at V$SQLTEXT, V$SQLAREA and a few other tables but
>I have been unsuccessful in determining which SQL statement
>caused the error.
>
>Thanks in advance for any help.
>
>Joe Lofft
>lofftjm_at_itec.suny.edu
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Jan 28 1999 - 03:49:26 CST

Original text of this message

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