Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 13: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, 10: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

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