If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > retrieving line of last error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-25-02, 05:49
fhermisch fhermisch is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 2
retrieving line of last error

Hello !

Is it possible to get the line-number where the last error ocurred ?

At example:

CREATE OR REPLACE PROCEDURE do_stupid
IS

tempNum Number;

BEGIN

FOR i IN 1..5
LOOP
temp := sysdate;
END LOOP;

tempNum := 2;

tempNum := tempNum / 0;

tempNum := 3;

EXCEPTION
WHEN OTHERS THEN


-- i want to access the line-number of the error "tempnum / 0"

END do_stupid;

Thank You !

Florian
Reply With Quote
  #2 (permalink)  
Old 02-25-02, 06:11
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
Hello,

you can access the errors of a compilation by using the following
SQL statement:

SELECT OWNER, NAME, TYPE, SEQUENCE, LINE, POSITION, TEXT
FROM SYS.ALL_ERRORS WHERE owner = 'SYS' AND name = 'NONAME';

or use the AlligatorSQL ;-)

Hope this helps ?

Manfred Peter
(Alligator Company)
http://www.alligatorsql.com
Reply With Quote
  #3 (permalink)  
Old 02-25-02, 06:54
fhermisch fhermisch is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 2
I want to catch runtime Errors. A "Division by zero" doesnt throw a compilation error. The "Division by zero" should only be an example for everything which could throw an error - there could also be a "index not found" or anything else.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On