Use SQL%found 

It's in the manual.  :)

Jared





"Hagedorn, Linda" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
03/13/02 12:34 PM
Please respond to ORACLE-L

 
        To:     Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc: 
        Subject:        Branching logic in PL/SQL, positive instead of exception


Hello, 
I'm looking for an example of structured PL/SQL code that does not use 
exception logic for branching, but instead recognizes that data is found.

As a bad example, 
 Select col1 from test.table t where exists (select z.zip from zip_table z 
where t.zip=z.zip ) into v_col1 ; 
 exception 
 when no_data_found 
   begin 
   select col2 from test.table2 t2 where exists (select z.zip from 
zip_table z where t2.zip=z.zip) into v_col1 ; ; 
   exception 
   when no_data_found 
     begin 
I've checked the books and cannot see how to test for a positive result 
instead of a negative (exception) result. 
Does anyone have a good example of branching logic on record found? 
Thanks, Linda 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to