Message-Id: <10562.112246@fatcity.com> From: "Cale, Rick T (Richard)" Date: Tue, 18 Jul 2000 03:36:18 -0700 Subject: RE: sql%found problem IMHO, a flaw in how this was implemented. An SQL%FOUND will always evaluate to TRUE for aggregate functions, BAD!!! I found this out in a Pro*C. I know Pro*c has it and pretty sure there is something comparable in plsql, I use sqlca.sqlerrd[2] which returns the number of rows processed. If 0 then not found. I think there is something for rows not found. In your case since you are using count you could say if v = 0 then not found but for all other aggregate functions this would not work. Rick > -----Original Message----- > From: paul [SMTP:pjohnpeter@qssnet.com] > Sent: Monday, July 17, 2000 9:44 PM > To: Multiple recipients of list ORACLE-L > Subject: sql%found problem > > hi all, > i had a problem over this query.could u tell me what is wrong in that > query. > ======== > declare > v number(10); > begin > select count(name) into v from str; > if sql%found then > dbms_output.put_line('yes '||v); > else > dbms_output.put_line('no '||v); > end if; > end; > it displays only "yes'' even though the table contins or not contain any > rows. > could u tellme what went wrong. > paul > >