Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    19

    Question Unanswered: 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?

  2. #2
    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;
    /
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •