Re: SQL Question
Posted in 1997
Topics: Error Codes & Troubleshooting
Hi,
I'm (just ?) an Oracle-user, but I wonder what great functions
Informix has to offer:
In the cursor you describe, you fetch a 'UNION' cursor into _two_
fields !?!
Has Informix got its own version of ANSI-SQL ???
Greetings,
Tolli
Claus Samuelsen <csa@sysdeco.dk> wrote:
>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.
>Thats easy.
>You should use a cursor:
>DECLARE union_curs CURSOR FOR "select .... union select ..."
>OPEN union_curs
>FETCH union_curs INTO var1, var2 .. varn
>remember to check sqlca.sqlcode
>best regards
>Claus Samuelsen
>Sysdeco Danmark A/S