Creating tables via Pro*C using variable names

From: Mike D Marchionna <mdm_at_wdl1.wdl.loral.com>
Date: Wed, 20 May 1992 17:54:19 GMT
Message-ID: <1992May20.175419.17302_at_wdl.loral.com>


Help! I'm a Oracle neophyte and I've run into a roadblock. I can't seem to get my Pro*C program to use a variable name in place of a table name. For example if I decalare a Oracle variable like this.

        VARCHAR OVtableName[30];

And then assign it a value like this:

	strcpy(OVtableName.arr,"NEW_TABLE");
	OVtableName.len = strlen(OVtableName.arr);

And then attempt to use it in a statement like:

	EXEC SQL CREATE TABLE :OVtableName
		(LINE NUMBER(5), TEXT CHAR(128));

I always get the following error:

        ORA-0903: invalid table name

I'm using Oracle 5.1A on Compaq 486 PC under MS-DOS 5.0 if that's any help. I have looked through all the example code I can find, and have not found one instance showing a Pro*C program using variable for a table name. Does anyone know what the heck I'm doing wrong?

--MDM
--


(  _______________________________   Brain, and brain!  What is brain!    ) 
 \________________________________)        --Star Trek (Spock's Brain)   /
El_Rayo_X_______________________________________________________________/ 
Received on Wed May 20 1992 - 19:54:19 CEST

Original text of this message