Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting Record into SQL from VFP App
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00405841
Message ID:
00405865
Views:
36
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform