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
|
|
Adding InvoiceLine: How to do it in a single statement? (nested SQL?) |
Author |
Message |
|
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? |
|
|
|
Tom |
|
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) |
|
|
|
|
Posted : 2007-12-14 12:03:42 |
|
|
|
|
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
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-12-28 16:13:14 |
|
|
|
|
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 |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-12-28 17:22:23 |
|
|
|
|