Re: SQL Question
Posted in 1997
What did you try? How hard is it to try a simple test case such as:
main()
{
$ int j; EXEC SQL SELECT Tabid INTO :j FROM SysTables
UNION
SELECT Tabid FROM SysColumns;}
to find that the INTO clause goes immediately after the first SELECT list
and prior to the first FROM clause? I tested that this compiled (it won't
run, of course, because it doesn't open a database) with ESQL/C 9.12.UC1,
but I don't think the behaviour would be different in any earlier versions.
And if you're using I4GL or NewEra (which your syntax suggests is the
case), the same test technique works, does it not?
Yours,
Jonathan Leffler (johnl@informix.com) #include <witticism.h>
>From: Kurt Van Wagoner <kurtv@enrich.com>
>Date: Thu, 14 Aug 1997 09:11:31 -0600
>X-Informix-List-Id: <news.41650>
>
>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.