NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

log the local variables (string type) to the database (SQL Server)

i have a customized PreUUT callback so that my own VI gets the information from barcode. it contains serial number as well as other information. i am collecting the information into local variables of the PreUUT callback.
 
Now i want to log the local variables (string type) to the database (SQL Server).
i have a successful connection to the database and i am using a generic recordset schema.
 
 
 
 
can anyone help me how to do it?
 
also shall i have to create the corrosponding fields (columns) in the database? or is there any option in TestStand4.0 to do it?
0 Kudos
Message 1 of 3
(3,282 Views)
Hi i like original,

Once you have the connection to your database setup, you can use the Open SQL Statement / Close SQL Statement database steps.  In the Open SQL Statement step, you can manually enter the SQL statement that is executed.  An example that would update the Num field a previously created database record with an ID of 5 with the value of the local variable Number is listed below:


"UPDATE Table SET Num = '"+Locals.Number+"' WHERE ID = 5"

You will want to use the Close SQL Statement step afterwards in order to fully close the SQL session.
0 Kudos
Message 2 of 3
(3,248 Views)
Hello i like original,

After re-reading your original message, I think I might have a better understanding of what you would like to do.  I have included a few links to Knowledge Base and Developer Zone articles that should be very useful for you.  I have included these links below:
0 Kudos
Message 3 of 3
(3,231 Views)