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: rjamya <rjamya_at_gmail.com>
Date: Mon, 26 Jun 2006 11:00:51 -0400
Message-ID: <9177895d0606260800h591a2b75g426d9b839ccba0b6@mail.gmail.com>


First,

your code shouldn't compile. And even if it compiles, it is doing exactly what you are telling it to do. You are not doing with any of the fetches and just outputting a message when cursor doesn't find anything.

Raj

On 6/26/06, xiaoyan <xiaoyezi.xyz_at_163.com> wrote:
>
>
> Now in my preject,I need to use cursor like this:
>
> CREATE OR REPLACE PROCEDURE test(p_name VARCHAR2) IS
>
> CURSOR categories_cur (p_str VARCHAR2) IS SELECT describe FROM
> categories
> WHERE name=p_str ;
> v_describe categories.describe%TYPE;
>
> 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');
> END IF;
> END test;
>
>
> 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?
>
> Thanks in advance!
>

-- 
----------------------------------------------
Got RAC?
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 26 2006 - 10:00:51 CDT

Original text of this message

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