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