Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: help for cursor

Re: help for cursor

From: Nigel Thomas <nigel_at_preferisco.com>
Date: Mon, 26 Jun 2006 08:05:16 -0700 (PDT)
Message-ID: <20060626150516.2692.qmail@web54710.mail.yahoo.com>


> The procedure 'test' is compiled successfully,but the result is:
> categories_cur%NOTFOUND is true
> which indicate no records in categories_cur,who can tell me why?
   

Your cursor loops through all results, then after the last fetch prints the 'not found' message; it's not doing anything with the data it does select. Add these lines and you'll see what I mean. NOTFOUND really means END OF FETCH...

BEGIN      
      OPEN categories_cur(p_name);
      LOOP
            FETCH categories_cur INTOv_describe;
            IF(categories_cur%NOTFOUND)
            THEN
               DBMS_OUTPUT.PUT_LINE('categories_cur%NOTFOUND is true');  
            ELSE
               DBMS_OUTPUT.PUT_LINE(v_describe);
            END IF;   

END test;  

Regards Nigel  

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 26 2006 - 10:05:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US