Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL Cursor-attribute %ROWCOUNT

16310Mar 21 2002
Hi to everybody,
I have a question regrading to Cursor attributes.
I'm written a funtion(you can see the code below) with REF CURSOR as its Return value.
Now I want to use the Cursor Attribute ROWCOUNT to check out how many rows the function gives back, but I always become 0.
The funtion itself work without any problems except for the ROWCOUNT Attribute which gives always 0 back.

Can somebody told me what I make wrong????

Thanxxx

Schoeib Amin

Create or Replace Function PIFS.indizierteWerte_fr_test
(match IN string,
Dauer IN number)

return
types.cursorType --Package where I defined a REF CURSOR TYPE

AS

Rate1 number;
match_ VARCHAR2(15);
c_cursor types.cursorType;

Anfangsdatum date;
jetziges_datum date;
Anzahl number;

BEGIN
match_:=match;
Anfangsdatum:=gebe_anfangsdatum(Dauer);
jetziges_Datum:=sysdate;
Rate1:=berechne_fr(match_,Anfangsdatum);

OPEN c_cursor FOR
Select
(fr.indiziert)*Rate1 INDIZIERT,fr.DATUM
from
fondsreihe fr
where
fr.match=match_
and fr.Datum between Anfangsdatum and to_char(jetziges_Datum,'DD.MM.YYYY') order by fr.DATUM;


anzahl:=c_cursor%ROWCOUNT;
dbms_output.put_line(anzahl);

return c_cursor;

END indizierteWerte_fr_test;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2002
Added on Mar 21 2002
8 comments
2,924 views