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 -> how to do multiple variable selects in a trigger

how to do multiple variable selects in a trigger

From: Asya Kamsky <asya_at_bayarea.net>
Date: Fri, 12 Mar 2004 21:31:16 -0000
Message-ID: <1054b145qgsgp76@corp.supernews.com>


I'm trying to write a trigger on t1 that in effect does this inside:

..
DECLARE

i NUMBER;
j NUMBER;
k NUMBER;

BEGIN
...

   SELECT id1 into i, id2 into j, id3 into k FROM t2    WHERE t2.id = :new.id;
...

I get compilation errors and they seem to be around this attempt to select multiple columns into multiple variables.

Is there a way to do this (without the redundant multiple selects, as I can do SELECT id1 into i FROM t2 just fine, but don't want to do it three time!)

Thanks,

--
Asya Kamsky

In our society, you can state your views, but they have to be correct.
           ---  Ernie Hai, coordinator Singapore Gov't Internet Project
Received on Fri Mar 12 2004 - 15:31:16 CST

Original text of this message

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