From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DB Tools: Find Closest Match Query and Retrieve

Hello all,

Need some advice on the route you'd take with the given situation:

I'm not too familiar with SQL, so i'm not sure of which would be the most practical way to proceed.  I have a database (and the database toolkit), which I write a cluster of values to.  There's about 25 columns of data per record.  I'd like to have a search box, where the user types in a value, the program looks in 1 specific column and a record is retrieved and displayed into an identical indicator cluster.

How detailed the search is I guess is limited to whats available.  Its probably not practical to have only the identical phrase show up, as what happens if they forget a dash or some other character.  I think an option box would be best, or maybe a wildcard symbol if even possible?  So user types in Lab* and options populate to LabVIEW, LabTest, LabResults etc.  They select - and view record.

What's your input on this?  Anyone ever done an application like this they wouldn't mind giving some pointers on?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 1 of 3
(2,661 Views)
I believe that wildcard support is dependent on the DBMS you have, but it is probably available. A search through the help of your specific DBMS should help.

Another option, if the number of records is not too big, is to select just that column and then search through it yourself. You can see an example of how to dynamically filter a list in the utility posted here. The most recent version is in reply 31, but I plan on posting an updated version later today.

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,639 Views)
Yep there should be wildcard support...I'm handling that with an SQL command...A bit later today I'll post what I've done so far for some feedback.

The SQL reading into the query function is:

SELECT * FROM tablename WHERE columnname LIKE '*searched_term*';

Its untested so far but in SQL i believe that will output a list of all available options in that column with the searched term somewhere in the expression.  I'm not sure how LV will handle that though...array output?  Not sure  Might not get a chance to work on it any today (Deadline on another high priority project), but like I said I'll try and at least get a jpeg, if not today - tomorrow!




Message Edited by leachdor on 02-18-2008 08:42 AM
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 3 of 3
(2,624 Views)