Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : trying to insert bill, "Expected Lexical Element Not found" errorSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 trying to insert bill, "Expected Lexical Element Not found" error 
 Author   Message 
  rob 
  
 Group: Members 
 Posts: 4 
 Joined: 2006-06-27 
 Profile
 Posted : 2006-06-27 05:59:09

Hi,

I get the following error:
"[QODBC] Expected Lexical element not found: From"

when trying to execute this SQL command:
select ListID = (select ListID from Vendor where Name = 'ABC')

I am trying to insert a new bill, but my program only knows the Vendor Name, not the vendorRefListID, so I have to query for it.  I am trying to do this all in one statement as follows, but QODBC gives the above error:

INSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "DueDate", "Memo") select VendorRefListID = (select ListID from Vendor where Name = 'ABC'), APAccountRefListID = (select ListID from account where Name = 'Accounts Payable'), {d'2006-06-26'}, '100', {d'2006-06-30'},'Expense Memo Test 5'

(of course the above insert is done after the invoice details are first inserted)

is there a better way to do this query?
thanks!
rob

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-27 09:49:23

When doing INSERTs you need to use either the ListID or FullName, so in your case you can use the FullName like this:

INSERT INTO "Bill" ("VendorRefFullName", "APAccountRefFullName", "TxnDate", "RefNumber", "DueDate", "Memo")
VALUES ('ABC', 'Accounts Payable',  {d'2006-06-26'}, '100',  {d'2006-06-30'}, 'Expense Memo Test 5' )

See: How do I create Bills? for more.

 

  Top 
  rob 
  
 Group: Members 
 Posts: 4 
 Joined: 2006-06-27 
 Profile
 Posted : 2006-06-27 11:20:17
thanks!  that makes life much simpler

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to