Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERTING into SQL server table from VFP Cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00985368
Message ID:
00985745
Vues:
36
You don't have to build the entire SQL string by replacing values. The beauty of VFP is that you can use file variables in SPT calls. For example,
mySQL = "INSERT INTO u_cinvoices (u_cinum,u_cidate,u_ntotamt) VALUES (?cInum, ?cidate, ?ntotamt)"
Where values are variables your cursor/table being scanned.

>Thank you for your response.
>
>The simplest solution for now is probably to do as you suggest SCAN ...INSERT ...ENDSCAN.
>
>Using this method, I am able to insert strings as variables but I am having a problem when trying to populate data with variables created from dates and numbers
>
>How can I substitute mydate and myvalue variables in the INSERT statement below where mydate=date() and mynum= 999 ??
>
>mySQL= [INSERT INTO u_cinvoices (u_cinum,u_cidate,u_ntotamt) ]+;
> [ VALUES (]+;
> [ '&cinum' ]+[,]+;
> [ '2/10/05' ]+[,]+;
> [ 999 ]+[,]+;
> [ )]
>
>Thanks in advance
>Carmel
- Jayesh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform