LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search a value in a database and return all the valuesin a line of the table

I want to be able to search a unique value in a table of an SQL database and if the value is found, I want to be able to return all the values in the row of the table in the database. I want to be able to manipulate each value in the row separately.

Can someone please give me an example, because I'm new to labview and I don't know how to do this.

0 Kudos
Message 1 of 7
(3,297 Views)

Do you know how to make an SQL query in LabVIEW?  It sounds like "SELECT * FROM [a table] WHERE [a field] = "a unique value" will get your row.  What have you got so far?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 7
(3,279 Views)

I like to use the Execute Query function:

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 7
(3,271 Views)

Today's fun fact - dropping this snippet on a Block Diagram crashes LabVIEW 2013 every time for me.  Does anyone else see this?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 7
(3,256 Views)

I don't have LV 2013 on this machine to test, but it did crash LV 2014 on me.

 

DAbort 0x1A7102DF in fpsane.cpp

 

That points to the front panel.  But one thing I find odd about your snippet is that the string constant is partially cutoff.  I thought the CCT would always grap the entirety of any selected objects.

0 Kudos
Message 5 of 7
(3,252 Views)

I intentionally didn't select any of the string constant.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 7
(3,227 Views)

DB.png

Instead use select. In the coulms input you can mention coumns name you need. Output will be 2D array. Change and manipulate as per your requirement

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 7
(3,220 Views)