Jump to content
Sign in to follow this  
BigAngryHillMan

Teststand SQL database

Recommended Posts

There seem to be very few examples of how to get results out of the standard Teststand SQL database. There is a top level table called UUT_RESULT but it may not be obvious to a new user how to get the results from a test run in the UUT_RESULT table with a given ID GUID.

To this end I give an example below in the hope it saves someone else the pain of surfing the internet trying to find an example.

The SQL script below when run will return all the results for a test. Obviously you will still need to read up on SQL but it is a good starting point.

There is a comment in the code on how to make sure only tests with results are returned.

The SQL script is a lot more readable when coloured in a SQL editor.

DECLARE @UGID [nvarchar](50) SET @UGID = 'C26760D9-3FE4-4500-99FA-6B4B26341563' SELECT        	RTRIM (UUT_RESULT.UUT_SERIAL_NUMBER) AS UUT_SERIAL_NUMBER,RTRIM (UUT_RESULT.START_DATE_TIME) AS START_DATE_TIME, RTRIM (UUT_RESULT.USER_LOGIN_NAME) AS USER_LOGIN_NAME,              	RTRIM(UUT_RESULT.STATION_ID) AS STATION_ID,              	RTRIM (UUT_RESULT.UUT_STATUS) AS UUT_STATUS,RTRIM (STEP_RESULT.ORDER_NUMBER) AS ORDER_NUMBER,RTRIM(STEP_RESULT.STEP_GROUP) AS STEP_GROUP, RTRIM(STEP_SEQCALL.SEQUENCE_NAME) AS SEQUENCE_NAME,              	RTRIM(STEP_RESULT.STEP_NAME) AS STEP_NAME,RTRIM(PROP_NUMERICLIMIT.COMP_OPERATOR) AS COMP_OPERATOR, RTRIM(STEP_RESULT.STEP_TYPE) AS STEP_TYPE, RTRIM(STEP_RESULT.STATUS) AS STATUS,RTRIM(PROP_RESULT.DATA) AS RESULT,              	RTRIM(PROP_NUMERICLIMIT.LOW_LIMIT) AS LOW_LIMIT,RTRIM(PROP_NUMERICLIMIT.HIGH_LIMIT) AS HIGH_LIMIT,              	RTRIM(STEP_RESULT.MODULE_TIME) AS MODULE_TIME,RTRIM(STEP_SEQCALL.SEQUENCE_FILE_PATH) AS SEQUENCE_FILE_PATH,RTRIM(PROP_NUMERICLIMIT.UNITS) AS UNITS,              	RTRIM(UUT_RESULT.EXECUTION_TIME) AS EXECUTION_TIME,              	RTRIM(STEP_RESULT.ERROR_CODE) AS ERROR_CODE,RTRIM(STEP_RESULT.ERROR_MESSAGE) AS ERROR_MESSAGE,RTRIM(UUT_RESULT.UUT_ERROR_CODE) AS UUT_ERROR_CODE,RTRIM(UUT_RESULT.UUT_ERROR_MESSAGE) AS UUT_ERROR_MESSAGE                  	FROM 		UUT_RESULT INNER JOIN                  	STEP_RESULT INNER JOIN                  	STEP_SEQCALL ON STEP_RESULT.STEP_PARENT = STEP_SEQCALL.STEP_RESULT ON UUT_RESULT.ID = STEP_RESULT.UUT_RESULT LEFT OUTER /*INNER */JOIN -- SWAP LEFT OUTER FOR INNER TO miss out steps without results.                  	PROP_NUMERICLIMIT INNER JOIN                  	PROP_RESULT ON PROP_NUMERICLIMIT.PROP_RESULT = PROP_RESULT.ID ON STEP_RESULT.ID = PROP_RESULT.STEP_RESULTWHERE 	(STEP_RESULT.UUT_RESULT = @UGID)ORDER BY STEP_RESULT.ORDER_NUMBER

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.