Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting Record into SQL from VFP App
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00405841
Message ID:
00405865
Vues:
45
I've almost got it, but not quite. I've been able to insert a record if I use actual values, but not if I use variables. Here is the command I'm using that works and then what I want to do:

sqlexec(gnConnHandle,"Insert into CQIPATIENTS (FacilityID, DeptID, PatNumber,LastName,FirstName) Values (1,1,'C11','Kelly','Kirk')")

The above statement works, but I want to do the following:

sqlexec(gnConnHandle,"Insert into CQIPATIENTS (FacilityID, DeptID, PatNumber,LastName,FirstName) Values (gnFacID,gnDeptID,gcPatNumber,lcLastName,lcFirst)")

This one comes back and tells me:
gnFacID is not permitted in this context. Only constants, expressions, or variables are allowed here. Column names are not permitted.

I have also tried putting the @ in front of each variable, but to no availe
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform