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 : Adding InvoiceLine: How to do it in a single statement? (nested SQL?)Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v8 Forum

 New Topic 
 
 Post Reply 
[1]  
 Adding InvoiceLine: How to do it in a single statement? (nested SQL?) 
 Author   Message 
  samster 
  
 Group: Members 
 Posts: 4 
 Joined: 2007-12-12 
 Profile
 Posted : 2007-12-13 10:59:03
Hello!

Overall, QODBC is working fine. I am using the new QODBC (just downloaed, v8) against QB07 Premier (but need this code to work on all QB 06 and up if possible). But I am stumped by one issue: How to easily, in a single SQL statement, add InvoiceLine records using item names (not ID's).

Example that works:

INSERT INTO "InvoiceLine"
  ("TxnID", "InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "FQSaveToCache")
  VALUES
  ('5D4C-1197748281', '80000055-1197748323', 'My Cool Stuff that just sold',         1.00000,                11.11,          0)


Code that I want to work but it does not:


INSERT INTO "InvoiceLine"
  ("TxnID", "InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "FQSaveToCache")
  VALUES
  ('5D4C-1197748281', select ListID from item NOSYNC where Name = 'WIDGET', 'My  Cool Stuff that just sold',         1.00000,                22.11,          0)


When I try the above, I get this error:

   [QODBC] Expected lexical element not found: <identifier>



Next step? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-12-13 12:55:22

Just do:

INSERT INTO "InvoiceLine"
  ("TxnID", "InvoiceLineItemRefFullName", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "FQSaveToCache")
  VALUES
  ('5D4C-1197748281', 'WIDGET', 'My Cool Stuff that just sold',         1.00000,                11.11,          0)

 

  Top 
  samster 
  
 Group: Members 
 Posts: 4 
 Joined: 2007-12-12 
 Profile
 Posted : 2007-12-14 12:03:42
thanks! 

  Top 
  MacTorvald 
  
 Group: Members 
 Posts: 29 
 Joined: 2007-08-22 
 Profile
 Posted : 2007-12-28 16:05:30
I do not know concatenate the query below to be implemented with the sql server linked, could give me an example please
 

Just do:

INSERT INTO "InvoiceLine"
  ("TxnID", "InvoiceLineItemRefFullName", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "FQSaveToCache")
  VALUES
  ('5D4C-1197748281', 'WIDGET', 'My Cool Stuff that just sold',         1.00000,                11.11,          0)

 
Instead of making a select within the openquery, as I step values?
 
Thank you for you
Attention
 
Regards
 
Mac Torvald
 
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-12-28 16:13:14

See: How do I do INSERTs, UPDATEs and DELETEs using OPENQUERY with Linked MS SQL Servers? 

 

  Top 
  MacTorvald 
  
 Group: Members 
 Posts: 29 
 Joined: 2007-08-22 
 Profile
 Posted : 2007-12-28 16:55:49

Thank you for your quick response. I received this linked many times that I asked this question. However, my problem is the following.

I have a third party software that performs the invoices of my business. I got a solution that captures this information and I need to provide the necessary fields to the QODBC to create a invoice on quickbook by sql server linked tables ("openquery statement").

Thanks for your attention

Regards,

Mac Torvald

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-12-28 17:22:23
Try looking at: VB Script Performance importing from SQL Server to QuickBooks  

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to