11-10-2017 01:43 PM - edited 11-10-2017 01:44 PM
11-10-2017 02:13 PM
How often is "progressively"?
I generally avoid doing that.
11-10-2017 02:26 PM
11-10-2017 02:37 PM
You don't want to be opening/closing a database every 250 msec.
11-10-2017 03:23 PM
@njacacia wrote:
You don't want to be opening/closing a database every 250 msec.
Ok, What is the best way to go from a data stream (Which will run for days+) to a database?
11-10-2017 04:59 PM - edited 11-10-2017 05:01 PM
Assuming SQL (I'm not experienced enough to know if this applies to other Database servers). Use basic Insert statements (use string commands).
In this manner, you only need "DB Open Connection.vi", "DB Execute Query.vi", "DB free object.vi", and "db close connection.vi"
We will build an insert statement and wire it to the SQL query of the DB Execute Query.vi
Assuming a table with 2 names ("column A", "column B") named Test_Table.
"Insert Into Test_Table (column A, column B)
Values (1,2),(3,4)(5,6)"
Will insert the following.
Column A ColumnB
1 2
3 4
5 6
In this manner, a single connection and insert statement can insert multiple records. Simply store your data for a predetermined # of records (shift register for example), then create and execute the insert statement. Each row of data is contained within the parenthesis. The comma delimited list can be extended as far as you want (be wary of timeouts however).
Adjust column names and the number of columns as you require. I hope i attached the snippet properly.