NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

database query with parameters (Teststand Database Step Type)

Hello,
I am trying to use TestStand (2012) database step types but with no success so far...
My query looks like this:

"SELECT ffPart.PartNumber FROM ffPackage INNER JOIN ffPart ON ffPackage.CurrPartID = ffPart.ID WHERE ffPackage.SerialNumber = '" + Locals.BoxSerial + "'"

I have put a check mark next to Statement requires Parameters

The next statement is "DataOperation/ Execute- Set parametres and execute" where I do the parameters mapping.

 

1.jpg
The third statement is "DataOperation/ Close - Close and get Output Parameters" where I am trying to read ffPart.PartNumber.

 

2.jpg


So far everything fine, but when I am trying to run the sequence I get an error that the output parameter is not set ???
Actually it is an output parameter and value field are greyed out by default.
Can anyone help me?
Thanks in advance,
Cristian

0 Kudos
Message 1 of 4
(3,986 Views)

Hi,

 

The "ffPart.PartNumber" was specified in your first screenshot as having a return value rather than an output. This might explain why it isn't being seen as an output parameter.

 

Also, a little background context on what you're trying to accomplish with this would be helpful.

 

Hope this helps!

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 4
(3,929 Views)

Hi,

What is the difference between a "Return value" and an "Output"? In both cases values cannot be set...

Regarding your question, I just want to run a select query with parameters:

"Select param_out from table where param_in = x"

Kind regards,

Cristian

0 Kudos
Message 3 of 4
(3,916 Views)

In both of those cases, TestStand is expecting to retrieve a value from the database. More specific information can be found here.

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 4 of 4
(3,899 Views)