Re: Dynamic SQL, Creating Table and insert into table
Date: Fri, 09 Jul 1993 16:32:41
Message-ID: <930709163241_at_dlpc030.dlogics.com>
In article <C9vIB1.AKv_at_ms.uky.edu> rama_at_ms.uky.edu (Sivakumar Ramamoorthy) writes:
> i.e. I need something like
> EXEC SQL CREATE TABLE:X AS SELECT * FROM ANOTHERTABLE;
> Which of the four modes of dynamic SQL
> namely
> 1. EXECUTE IMMEDIATE
> 2. PREPARE AND EXECUTE
> 3. PREPARE AND FETCH
> 4. PREPARE, DESCRIBE AND FETCH
>
> should I use.
Any of them. The solution is to construct the sql string using C runtime
functions, such as strcpy() and strcat(). You cannot use a bind variable
for a table or column name in any SQL.
--
Dave Mausner / Sr Consultant / Datalogics division of Frame Technology Inc
441 W Huron / Chicago IL 60610 / +1-312-266-4450 / "Just show me the code"
Received on Fri Jul 09 1993 - 16:32:41 CEST