From: "Youtz" <youtz(_NO_SPAM)@hotmail.com>
Newsgroups: comp.databases.oracle.misc
Subject: get the SQL that raised an error.
Date: Wed, 8 Aug 2001 15:21:59 +0200
Organization: World Youtz Company
Lines: 23
Message-ID: <9kreb8$m2q$1@news.worldcom.ch>
NNTP-Posting-Host: inser253.worldcom.ch
X-Trace: news.worldcom.ch 997276840 22618 212.74.158.253 (8 Aug 2001 13:20:40 GMT)
X-Complaints-To: usenet@news.worldcom.ch
NNTP-Posting-Date: 8 Aug 2001 13:20:40 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3612.1700
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700


Hello,
I'ld like to get the command that raised an error to stock it in an alert
table, I don't know which view or table to use for that, I tried with :

SELECT sql_text
  FROM v$sqltext
    WHERE (address, hash_value) IN
          (SELECT sql_address,
                            sql_hash_value
               FROM v$session
                   WHERE audsid = userenv('SESSIONID'))
                  order by piece;

But if I run that I get the select that I'm currently executing (SELECT
sql_text FROM v$sqltext...).

How can I do to get the previouse command and not the current one or even
better the exact one that raised an error ?

Thanks in advence,
Youtz.



