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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Pl/SQL-statement

Re: Pl/SQL-statement

From: GKatteri <gkatteri_at_fastmail.fm>
Date: Mon, 10 Nov 2003 17:24:25 -0800
Message-ID: <F001.005D63E4.20031110172425@fatcity.com>

begin
  select 'y' into dummy
   where table3.column = table1.column;
  insert into table3 blah blah;
  exception
  when no_data_found then
   begin

     select 'y' into dummy
     where table2.column = table1.column;
     insert into table2 blah blah;

   exception
    when no_data_found then
     do reqd tasks;
    when others then
     blah blah;
    end ;
   when others then
     do reqd tasks;
end;

HTH
GovindanK

On Mon, 10 Nov 2003 06:54:25 -0800, roland.skoldblom_at_ica.se said:
> Hallo,
>
> I would like to do the following with an sql( pl/sql) statement.
>
> I have table1 and table2 andtable3.
>
> I want to check whether field1 in table1 exists in table3. If so then I
> want an insert statement to be run...insert into table3.....
> If it doesnt find that value then th escript will go to table2 and check
> if the vaules exists in that table, if it finds it then I want another
> insert statement to be run.
>
> Please help me with an easy example, i dont know if this is so simply but
> I cantget it right though.
>
>
> Thanks
>
>
> Roland
>
>
>
>
>
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author:
> INET: roland.skoldblom_at_ica.se
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (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).

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: GKatteri
  INET: gkatteri_at_fastmail.fm

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (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).
Received on Mon Nov 10 2003 - 19:24:25 CST

Original text of this message

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