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

Home -> Community -> Usenet -> c.d.o.server -> Re: Determining number of rows returned by a cursor

Re: Determining number of rows returned by a cursor

From: Bob Withers <bwit_at_pobox.com>
Date: Sun, 29 Aug 1999 12:56:45 GMT
Message-ID: <MPG.1232e7cd3387225a989698@news.mciworld.com>

Actually, %ROWCOUNT returns the number of rows fetched from the cursor. If called immediately after opening a cursor it will always return zero.

Regards,
Bob

In article <S6Ux3.4676$r4.2724_at_news.indigo.ie>, mjjugs_at_gofree.indigo.ie says...
> %rowcount will only count the number of rows that meets the criteria defined
> sql statement of the cursor.
> if %rowcount=0 shows that no rows have been returned
> If %rowcount>0 then ..... hold a count of the number of rows returned.
>
> rickowen_at_my-deja.com wrote in message <7q4hsb$eqb$1_at_nnrp1.deja.com>...
> >I am writing some procedure in pl/sql. Assuming I have a cursor such as:
> >
> >cursor mycursor (mysearch in varchar2) is
> > select name, id
> > from employee
> > where upper(name) like '%' || upper(mysearch) || '%'
> >
> >is there any way to determine the number of rows returned by such a
> >cursor so that I could do something like:
> >
> >if mycursor%RECORDCOUNT then
> > -- do something that involves the cursor
> >else
> > -- let the user know their search failed
> >end if;
> >
> >I know about %ROWCOUNT, but I would like to know before I actually
> >execute the cursor whether or not it will return rows.
> >
> >Thanks.
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Share what you know. Learn what you don't.
>
>
>

--


Bob Withers               Do or do not, there is no try
bwit_at_pobox.com                                  Yoda
http://www.pobox.com/~bwit
Received on Sun Aug 29 1999 - 07:56:45 CDT

Original text of this message

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