[QODBC-Desktop] How to Insert Multiple Records into TimeTracking Table
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 03:32 PM
|
|
Instruction:When inserting multiple records into a line item table, you can use column FQSaveToCache. Set column FQSaveToCache to 1 in all insert queries except the last line set to 0. But table TimeTracking is not a line item table; there is no FQSaveToCache column in that table. So you need to use the alternate method. This article will show you how to use the sp_batch command to insert multiple records into TimeTracking. If you are unfamiliar with the sp_batch statement, please refer to This article for more information. First, please run the following: SP_BATCHCLEAR Time tracking This command will remove all cached data from the TimeTracking table. It will make sure only the queries below will be executed.
Then run this query to start the batch: SP_BATCHSTART Time tracking When this query is executed, all queries later will be stored in the cache instead of directly sending to QuickBooks
Then run your insert queries. Here we use our test company file as an example: INSERT INTO TimeTracking (EntityRefListID, DurationMinutes, TxnDate, CustomerRefFullName, ItemServiceRefFullName, PayrollItemWageRefFullName) Values ('60001-1039046236',540, {d'2022-01-06'},‘' Kim: Garland'’, 'Installation Labor,' 'Sick -Salary')
INSERT INTO TimeTracking (EntityRefListID, DurationMinutes, TxnDate, CustomerRefFullName, ItemServiceRefFullName, PayrollItemWageRefFullName) Values ('F0002-1039046343',600, {d'2022-01-06'}, ‘'West: Test'’, 'Installation Labor,' 'Sick -Salary')
After all insert queries are executed, upload all cached queries to QuickBooks using this command: SP_BATCHUPDATE Time tracking This query will upload all queries in the cache to QuickBooks.
| |
|
I would like to inform you that VB Demo is just an application to test your queries or connection. It is the default behavior of VB Demo you can execute only one command at a time. You can use other ODBC application like MS Access or can write VBA code. Please refer below mentioned article for sample VBA code:
http://support.flexquarters.com/esupport/index.php?/Knowledgebase/Article/View/2571/0/using-quickbooks-data-with-vba