NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to log an array to a database using only one statement?

I'm using Teststand 2.0.1. Now I can use "database options.." to log single number or string to Oracle database with no problem. But I have the difficulty to log an array to my database by using only one statement. Does Teststand has the ability to loop the stepresult usingthe array size as an index to log the array to the database? Or some other way to log array?
0 Kudos
Message 1 of 3
(3,157 Views)
Jingtao -
You have a two options to log array data:
1) Use the Str expression function to convert the array of number property to a string with elements delimited by some character like a comma or space. You could then the single value to a variable string field. To retrieve the data you will have to parse the string to repackage the data.

2) Log the data directly to a binary field. TestStand takes the safearray version of the array and writes it byte for byte out to the field. To retrieve the data, you will have to pull it back into a safearray to repackage it in binary form.

Did you have a different way that you would have liked TestStand to use to store the data? What type of data field and what format of data?

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 3
(3,157 Views)
Of course!!
It would be awesome to be able to log more than one record at a time. Basically have like a TestStand Database function, that performs lots of the same INSERT SQL commands, and take the information to insert into the database from a given array. This will be wonderful!
0 Kudos
Message 3 of 3
(3,157 Views)