Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Parameterized CREATE TABLE in Oracle from VFP using ODBC????

Parameterized CREATE TABLE in Oracle from VFP using ODBC????

From: New Delhi <rajesh_at_simulate.com>
Date: 1998/09/02
Message-ID: <6skfr2$he1$1@picasso.op.net>#1/1

Hi,
I am trying to send a query from Visual Foxpro to Oracle using ODBC that looks like follows:

    SQLEXEC(g_connect_handle , "create table test as Select TO_CHAR  ?m.Param , '9999') as Row1 , d0055.* From d0055")

So what i want to achieve is that Oracle create a table for me where one  or more ) of the fields is parameterized.

I keep getting an error :

    [S1000] [Oracle][ODBC][Ora]ORA-01036: illegal variable name/number (1036)

I am tracing the calls made by ODBC and it fails on SQLEXECDIRECT :

It shows me the query as follows
"create table test as Select TO_CHAR(? , '9999') as Row1 , d0055.* From
d0055"

before this, it successfully makes a call to SQLBindParameter()

To indicate the type of field to create, I have included the TO_CHAR function but Oracle does not seem to be intelligent enough. Does using a particular ODBC driver make a difference? I have tried with Oracle's own driver and Microsoft's . Both have the same issue

The same thing works if I try to do it to an MS Access database by doing
"Select LTrim ( m.Param) as Row1 , d0055.* From d0055 into Table test".
Access creates a new table where Row1 is of type string with 255 field width.

The following however seems to work "Insert into Test Select TO_CHAR(?m.Param , '9999') , d0055.* From d0055" with Oracle. So i have a feeling that somehow in "create table" query it HAS TO ABSOLUTELY kNOW THE TYPE OF EACH FIELD IN THE TABLE. But I would like it if i could create the table in the same step rather than first creating and then inserting.

any help will be appreciated

Thanks

rajesh

rajesh_at_simulate.com Received on Wed Sep 02 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US