help: pro*c & creating tables

From: Seb Adams <sa103_at_york.ac.uk>
Date: 1995/05/25
Message-ID: <1995May25.172150.16770_at_zippy.dct.ac.uk>#1/1


hi,
i'm using pro*c and oracle v6 on a vax.
I'm trying to create a new table with a name that the user has entered on the command line. I copy this string into a varchar variable that is declared in the SQL declare section and then try to use this in a create table statement:

EXEC SQL BEGIN DECLARE SECTION;
VARCHAR tab_name[30];
EXEC SQL END DECLARE SECTION; in main I copy the argument into a string : strcpy(tab_name.arr,argv[3]);

and then create a table with the variable : EXEC SQL CREATE TABLE :tab_name

              ( etc etc );

Pro*c comes up with an error that bind variables cannot be used in a create statement. Does anyone know how to get round this ?

Another question :) I'm trying to do the same thing for column names and although this doesnt give me an error when compiling, the code does not execute.

Thanks for any help

--
Seb Adams    
email: sa103_at_york.ac.uk or mo_seba_at_vaxa.nerc-monkswood.ac.uk 
Biol Comp MSC
Uni York
Received on Thu May 25 1995 - 00:00:00 CEST

Original text of this message