Hi,
I have a custom database schema and I am trying to configure TestStand to use it for logging data.
In my main test execution table, I have a number of foreign key fields:
Operator_ID
Test_Type_ID
etc.
which look up the Operator and Test Type from their respective tables.
How can I populate these ID values from the Database Options schema?
I tried:
1) Using a sub-query in the but it then complains about the data types :
"INSERT INTO Test_Execution (
ID,
Serial,
Product_Code,
PPS,
Test_Type_ID,
Start_Time,
Execution_Time,
Operator_ID,
Station_Name,
Test_Version,
Status,
Result,
Error_Code,
Error_Message
) VALUES (?,?,?,?,(SELECT ID FROM Test_Type WHERE Name = ?),?,?,?,?,?,?,?,?,?)"
2) I also tried adding additional SQL statements before the Test_Execution statement but I couldn't get it to work and return the ID value to use in the Test_Execution statement (as a foreign key):

The error message is as follows:

Any ideas?
LabVIEW Champion, CLA, CLED, CTD
(blog)