Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating SQL to pass to SQL Server or Oracle
Message
De
10/10/2001 03:11:20
 
 
À
09/10/2001 17:12:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00566215
Message ID:
00566305
Vues:
13
Mike,

I don't know for Oracle but on SQL server I use :

SQLcmd = "SELECT * FROM TABLE1 T1 " + ;
"WHERE T1.field1 = ?MyFoxVariable1 " + ;
" AND T1.field2 = ?MyFoxVariable2 "

and the odbc driver does the work for me ...
Important : don't use functions, only variables after he '?' !

Pascal.

>I am connecting to an Oracle back-end and have to create my SQL as a string and pass that string to Oracle. That makes my code look like this:
>
>SQLcmd = "SELECT * FROM TABLE1 T1 " + ;
>"WHERE T1.field1 = " + MyFoxVariable1 + ;
>" AND T1.field2 = " + MyFoxVariable2
>and so on...
>
>I'd rather be able to use TEXT...ENDTEXT or something to look like:
>TEXT
> SELECT * FROM TABEL1 T1
> WHERE T1.field1 = <>
> AND T1.field2 = <>
>ENDTEXT
>
>The problem is that the TEXT goes to the printer or a text file.
>Does anyone have a better idea?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform