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

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

help for cursor

From: xiaoyan <xiaoyezi.xyz_at_163.com>
Date: Mon, 26 Jun 2006 22:51:48 +0800
Message-ID: <002201c69930$1003eb10$d88870ca@buaad538c81ca1>


when I make this query in sql*plus:

sql> select describe from categories where name=courses;

I get the following data:

NAME                DESCRIBE                                                                    

------------------------------
courses 计算机系 courses 数学系 courses 英语系 courses 物理系

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!

--

http://www.freelists.org/webpage/oracle-l Received on Mon Jun 26 2006 - 09:51:48 CDT

Original text of this message

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