NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL query for additional data

Anyone has an example of a SQL query for getting e.g a string value from an an additional result in the standard NI TestStand database.  

0 Kudos
Message 1 of 5
(218 Views)

If you are using the AdditionalResults Step Properties or the AdditionalResults Steps, the DataBase Reporting automatically puts this data into the DB.

 

0 Kudos
Message 2 of 5
(211 Views)

Hi

 

I which to retrieve the data already in the database via sql.

 

br

Nikolaj

0 Kudos
Message 3 of 5
(170 Views)

Sorry, I have misread your original question...

 

When creating that query, my guess is, that you need to consider the actual schema used for data base logging and hopefully. they have used the steps UID to reference the stuff within the tables...

0 Kudos
Message 4 of 5
(159 Views)

It's been a long time since I messed with this, but some research is starting to bring it back. Based on here:

https://www.ni.com/docs/en-US/bundle/teststand/page/default-teststand-table-schemas.html

 

I think additional results (under step properties) are linked as children in PROP_RESULT under the same STEP_RESULT. Something like:

SELECT *
FROM
UUT_RESULT AS UR
INNER JOIN STEP_RESULT AS SR ON SR.UUT_RESULT = UR.ID
LEFT JOIN PROP_RESULT AS PR ON PR.STEP_RESULT = SR.ID
LEFT JOIN PROP_RESULT AS PR_child ON PR_child.PROP_PARENT = PR.ID
WHERE
UR.UUT_SERIAL_NUMBER = '123123'

The join from UUT_RESULT to STEP_RESULT to PROP_RESULT is the default set for the normal TestStand schema. Then you can access the child of each additional result via a join with PROP_PARENT.

 

It's also possible that each additional result generates its own line in PROP_RESULT, in which case you can ignore the final self-join that retrieves the child data.

 

Then more filtering from there as you want to narrow down which results are pulled.

 

I don't have a database on-hand to test this unfortunately, so some of this is an educated guess, but hopefully this gets you started in the right direction!

Message 5 of 5
(139 Views)