Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters to SQL from VFP
Message
 
 
À
06/04/2005 23:18:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01002143
Message ID:
01002145
Vues:
16
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform