LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DB Tools: SELECT for checking if record exists?

Solved!
Go to solution

I am using the Database Connectivity Toolset.

Our IT guys adviced me that I should use the SELECT clause to check if a record exists in a table.

When I send from labview through a UDL file:

SELECT id

FROM [ProdTestData].[dbo].[TestResults]

WHERE MONumber='C00322'
 

I do not get anything back. See attached.
When the IT guys do the same from their API, they get back a number.

Do I need to add a FETCH or something else to my VI? 
  
  
  
  
  
  
  
  
  
  
  
 
 
 


Scientia est potentia!
0 Kudos
Message 1 of 3
(2,489 Views)
Solution
Accepted by topic author magyar

Try adding DB Tools Fetch Recordset Data.vi between your query VI and the Free VI.

Message 2 of 3
(2,484 Views)

That worked.

When i tried this previously, I did not click on "ShowType" in the variant indicator. So I didn't see anything in  the variant indicator if the record did not exist.

Thank you.

Scientia est potentia!
0 Kudos
Message 3 of 3
(2,479 Views)