Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Claus Samuelsen — — source: Informix-list mailing list archive (1991-1998)
Kurt Van Wagoner wrote:
>
> How do you do a select into variable with a union?
> i.e.
> I know
> select id, desc
> into var1, var2
> from tab1> But I do not know;
> select id, desc
> from tab1
> union
> select id2, desc2
> from tab2;>
> Any help would be appreciated.
1) declare a cursor
DECLARE union_curs CURSOR FOR "select .... union select ..."
OPEN union_curs
FETCH union_curs INTO var1, var2 .. varn
regards
Claus Samuelsen
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.