DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: No data found

  1. #1
    Join Date
    Jan 2001
    Posts
    515
    I am doing a select count(*) into v_cnt where ****;
    in my PL/SQL program and I am getting a no data found error. I thought that if you are doing a count it would be zero or greater than zero. How would I get a no data found error?

  2. #2
    Join Date
    Apr 2001
    Posts
    47
    Hi lesstjm,

    Are you sure you got the error because of this statement?
    COUNT function never returns null, that's true. Maybe you better debug you pl/sql program.
    Could you provide us with the whole text of your block?

  3. #3
    Join Date
    Mar 2001
    Posts
    635
    Hi

    True I tried out a small pl/sql block about the above subject and I never got any errors like no_data_foudn here is the pl/sql block I checked with

    declare
    a number(4);
    begin
    select count(*) into a from emp;
    dbms_output.put_line('Record count : ' || a);
    end;

    it returned me zero when there were no record in the above table

    Regards
    Santosh

  4. #4
    Join Date
    May 2001
    Location
    Atlanta US
    Posts
    262
    This error is obviously a user defined exception which is being raised when you run the PL/SQl.

    You would have something like this in your code in that case...:

    IF v_count = 0 THEN
    raise_application_error(-20102, 'No Data Found');
    END IF;

    Hemant

Posting Permissions

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


Click Here to Expand Forum to Full Width