Re: no rows selected vs.

From: spademan o---[ * <steve.eckersley_at_its.lancscc.gov.uk>
Date: 12 Feb 2002 08:21:42 -0800
Message-ID: <791c29f5.0202120821.2b26d76d_at_posting.google.com>


ivanhwg_at_iname.com (hwg) wrote in message news:<d93c1e25.0202101521.3539c017_at_posting.google.com>...
> would anybody can solve this issue for me please?
>
> i am counting number with the following query:
>
> select count(rowid)
> into zeronoaredi
> from emp1
> where
> empno NOT in
> (select empno from emp2
> where to_char(date_posted,'MON')=to_char(sysdate,'MON')
> )
> and
> empno NOT in
> (select empno from emp3
> where to_char(date_posted,'MON')=to_char(sysdate,'MON')
> )
>
> if NO ROWS SELECT is returned from the emp3 table, business logic
> still allowable(to take NO ROWS SELECT as zero), how can i still have
> the result to be selected into the varialble zeronoaredi, instead of
> being bounced to the exeception?
>
> thanx.
>
> hwg

Put your select statement into a cursor and use %notfound to set variable to 0.

Steve E. Received on Tue Feb 12 2002 - 17:21:42 CET

Original text of this message