NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Values from Database Error

Solved!
Go to solution

Can anyone help to explain the following error message? I was trying to get values from SQL database using Data Operation step (Database).

errormsg.JPG

Thanks,

Jane

 

0 Kudos
Message 1 of 3
(3,142 Views)

Just add some more information on my question:

when I set the SQL Statement as "SELECT module.module_id, module.module_name, module.batch_id  FROM module WHERE " + "module_name ='1308405199'", there is no error.But When changed the SQL Statement to "SELECT module.module_id, module.module_name, module.batch_id  FROM module WHERE " + "module_name ='+Locals.module_name+'", then the errors message came up. The Where Clause seems only accept constant value. Why? Did I input something wrong?

Thanks,

Jane

 

0 Kudos
Message 2 of 3
(3,138 Views)
Solution
Accepted by Jane.Yu

The TestStand property token must be outside the quotes. I believe this is what you want:

"SELECT module.module_id, module.module_name, module.batch_id  FROM module WHERE module_name='" + Locals.module_name + "'"

Scott Richardson
0 Kudos
Message 3 of 3
(3,129 Views)