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 > Raising an exception for "no rows selected"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-03, 12:11
feign3 feign3 is offline
Registered User
 
Join Date: Jan 2003
Posts: 19
Question Raising an exception for "no rows selected"

How can I raise an exception when no rows are selected from a query? Does "no rows selected" have an error code associated with it?
Reply With Quote
  #2 (permalink)  
Old 06-13-03, 09:53
dbmadcap dbmadcap is offline
Registered User
 
Join Date: May 2003
Posts: 87
Re: Raising an exception for "no rows selected"

The exception is no_data_found. Here is an example :

Code:
declare
  v_item number;
begin
  select item into v_item from orddtls where order_no=4476;
exception
  when no_data_found then
    dbms_output.put_line('no data found');
end;
/
Quote:
Originally posted by feign3
How can I raise an exception when no rows are selected from a query? Does "no rows selected" have an error code associated with it?
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