Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to do multiple variable selects in a trigger
"Asya Kamsky" <asya_at_bayarea.net> a écrit dans le message de
news:1054b145qgsgp76_at_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
Try
SELECT id1, id2, id3 into i, j, k FROM t2
WHERE t2.id = :new.id;
Regards
Michel Cadot
Received on Fri Mar 12 2004 - 15:45:16 CST