Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to SQL from VFP
Message
 
 
To
06/04/2005 23:18:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01002143
Message ID:
01002145
Views:
23
lnresult3 = SQLEXEC(gnhandle, "INSERT INTO " + lcTempFile + " (custno) VALUES ('test')")
>
>I'm having trouble passing a parameter of a temp file name to a SQL insert statement. I've figured out how to do it for a stored procedure I've written to create the proper table structure (where lnresult1 is assigned), and the temp table is being created properly. I just can't get the same technique (or any other) to pass the same temp table name as a parameter to an insert statement. Any thoughts are appreciated. Thanks!
>
>Rick
>
>************
>
>gnHandle = SQLCONNECT('SQL.ORACLE.PROACCESS', 'sa', 'golden')
>lcTempFile = 'temp' + SYS(3)
>
>lnresult1 = SQLEXEC(gnhandle, "EXEC spCreateTempImport ?lcTempFile" )
>
>*-- this works for a known table
>lnresult2 = SQLEXEC(gnhandle, "INSERT INTO tblImportAll (custno) VALUES ('test')")
>
>*-- but I can't find the right syntax to send the temp file name to the INSERT statement
>lnresult3 = SQLEXEC(gnhandle, "INSERT INTO ?lcTempFile (custno) VALUES ('test')")
>lnresult4 = SQLEXEC(gnhandle, "INSERT INTO ?(lcTempFile) (custno) VALUES ('test')")
>lnresult5 = SQLEXEC(gnhandle, "EXEC (INSERT INTO ?lcTempFile (custno) VALUES ('test') )" )
>lnresult6 = SQLEXEC(gnhandle, "EXEC (INSERT INTO ?(lcTempFile) (custno) VALUES ('test') )" )
>lnresult7 = SQLEXEC(gnhandle, "INSERT INTO (?lcTempFile) (custno) VALUES ('test')")
>lnresult8 = SQLEXEC(gnhandle, "EXEC (INSERT INTO (?lcTempFile) (custno) VALUES ('test') )" )
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform