Home » Developer & Programmer » Forms » select function
select function [message #81606] Wed, 05 March 2003 06:58 Go to next message
kim
Messages: 116
Registered: December 2001
Senior Member
hello,
i have a function that looks like this:

select courseid into chk_code from tr_course
where code = :key.code;

however, when there is no matching code in the table, it gives me the error ORA-01403. could someone tell me what i have to do to make it work? thanks. :)
Re: select function [message #81608 is a reply to message #81606] Wed, 05 March 2003 07:50 Go to previous message
Paul
Messages: 164
Registered: April 1999
Senior Member
Actually, its working perfectly, 01403 is a 'no data found' error.

If you want to avoid the error, create a numeric variable in your fuction then:

select count (*) into numeric_variable from from tr_course where code = :key.code;

then test the value of numeric_variable and only perform the regular select if it is > 0, otherwise just plug a value like 0000 or 'XXXX' into chk_code

or you could create an exception handler to trap the error and return a set value for chk_code if it occurs.
Previous Topic: Excel sheet processing
Next Topic: windows standard file open dialog box in forms....
Goto Forum:
  


Current Time: Fri Apr 26 20:25:17 CDT 2024