[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 you want to insert 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 not familiar with the sp_batch statement, please refer to This article for more information. First please run: SP_BATCHCLEAR Timetracking This command will remove all cached data from TimeTracking table. It will make sure only queries below will be executed.
Note: VB DEMO is to be used for testing of QODBC SQL queries only and is not a development tool.
Then run this query to start the batch: SP_BATCHSTART Timetracking When this query is executed, all queries later will be stored into 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 ('800000E4-1481796260',540, {d'2012-01-20'},‘Cook, Brian:Kitchen’,'Removal','Salary') INSERT INTO TimeTracking (EntityRefListID, DurationMinutes, TxnDate, CustomerRefFullName, ItemServiceRefFullName, PayrollItemWageRefFullName) Values ('800000E4-1481796260',600, {d'2012-01-20'}, ‘Cook, Brian:Kitchen’,'Removal','Salary') After all insert queries are executed, upload all cached queries to QuickBooks using this command: SP_BATCHUPDATE Timetracking 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