RE: URGENT. PLZ HELP.. LOOPING THRU RECORDS IN REFCURSOR

RE: URGENT. PLZ HELP.. LOOPING THRU RECORDS IN REFCURSOR

 

  

Farina,
To loop through the refcursor you need to fetch it:


DECLARE
CUR_TYPE PKG_TYPES.CURSOR_TYPE;
CUR_REC CUR_TYPE%ROWTYPE;
package.
BEGIN
SP_FETCHFEEBACKTRNDET('M9999','T002/M01','BT1',CUR_TYPE);

LOOP
FETCH cur_type INTO cur_rec;
EXIT WHEN cur_type%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(CUR_TYPE%ROWCOUNT); -- this will print 1
every
-- time a row was
fetched
END LOOP;
CLOSE CUR_TYPE;
END;


Hope that helps,
- ant

-----Original Message-----
From: Farina Janet (CMA Consulting)
[mailto:oracledba-ezmlmshield-x61574733.[Email address protected]
Sent: Wednesday, June 02, 2004 8:44 AM
To: LazyDBA.com Discussion
Subject: RE: URGENT. PLZ HELP.. LOOPING THRU RECORDS IN REFCURSOR

Where is your Select?

-----Original Message-----
From: Gururaj
[mailto:oracledba-ezmlmshield-x27934030.[Email address protected]
Sent: Monday, May 31, 2004 7:17 PM
To: LazyDBA.com Discussion
Subject: URGENT. PLZ HELP.. LOOPING THRU RECORDS IN REFCURSOR


Hi Oracle Gurus,


I am executing stored procedure from an anonymous pl-sql block,
where i am getting the REF CURSOR as output parameter.

Now i want to loop through all the records in the refcursor.

DECLARE
CUR_TYPE PKG_TYPES.CURSOR_TYPE; -- REFCURSOR declared
in
package.
BEGIN
SP_FETCHFEEBACKTRNDET('M9999','T002/M01','BT1',CUR_TYPE); -- Should
return records
DBMS_OUTPUT.PUT_LINE(CUR_TYPE%ROWCOUNT); -- NOT WORKING
END;

the rowcount gives always 0 irrespective of input passed.

THANKING IN ADVANCE

REGARDS
GURU




!-- Virus-Free Mail Using PostMaster Enterprise AvAc & QuickHeal Engine
--!

----------------------------------------------------------------
Bluechip Computer Consultants Pvt Ltd, Bangalore, India
Sent using PostMaster by QuantumLink Communications Pvt Ltd
One Internet account, unlimited personal e-mail addresses
Get your free copy of PostMaster at http://www.postmaster.co.in/


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: send a blank email to oracledba-[Email address
protected]
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: send a blank email to oracledba-[Email address protected]
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page