LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

display one column in a list from a table in sql database

 

Hi,

 

Currently i am trying to display all data in one Column. i have a table inside a database.
the table consist of a fixed number of columns and unlimited rows (the number of rows is unlimited because the rows are going to be added manually later on. but this is not the main concern right now).

 

i can get the connection to the database. but i only be able to view all the columns headers (the title for the columns).
However, i need to get the data in one column only and display it in a list. i have tried search through the internet, but i can not get the answer or the concept of doing it. and one more thing, i need to use the list as control...

 

Below is the example of the table and i only need to display all data in the Col1. But i ended up displaying [Col1 Col2 Col3 Col4]....

Col 1 Col 2 Col 3 Col 4
d1      
d2      
d3      
     
     
dn      

 

here, i attached my vi... sry, i just started to use labview and no one around me has ever use labview. i am very thankfull if anyone can give me ideas and guide me...

 

thanks..

0 Kudos
Message 1 of 13
(7,463 Views)
Sounds like you're using List columns inistead of Get data or what it's called.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 13
(7,458 Views)

Hi 

 

I am sorry, but i dont get you..

 

I need to display the data in a list that will be used as a control.... what is the difference between using "List columns" andf "Get data"....?

 

 

0 Kudos
Message 3 of 13
(7,449 Views)
It sounds like you need to take some SQL tutorials besides the LabVIEW ones. Your database has some columns and the names of the columns can be returned. The actual data in the columns is returned as the result of a SELECT command, i.e. SELECT column_name FROM table_name.
0 Kudos
Message 4 of 13
(7,440 Views)

 

Hi 

 

 

 

 

 

 

1.png

0 Kudos
Message 5 of 13
(7,424 Views)
What is the result of the fetch?

I don't have the toolkit installed so I don't know what the other functions you are calling after the fetch.
0 Kudos
Message 6 of 13
(7,419 Views)

There is a simpler way... I would suggest using the "DB Tools Select Data.vi" function instead. This function will return all data for a set of columns, or you can use the condition input to supply a sql-style query. Here is how this function will likely look with your database:

 

 LV Discussion pic.png

 

In the example finder, search for the LabVIEW Example "Connect to ACCDB Database.vi" for the reference code.

0 Kudos
Message 7 of 13
(7,407 Views)

 

Hi Logan,

 

Thanks for the suggestion...

what i need is only one column to be displayed inside a list which will be used as a control... Below is the list box i wanted... the displayed items are the in the same column... i tried your method, but it can only display the first item "kebab"..... but the interface of the one you suggest is not like in the image attahced...

i did try the sql-style query, but nthing change..... anyway, what do you mean by the sql-style query? do i need to use "EXECUTE" block...?

 

list box.jpg

 

 

Hi 

0 Kudos
Message 8 of 13
(7,363 Views)
Since you're using a string as database connector - have you set up the ODBC?
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 13
(7,352 Views)

Hi 

 

0 Kudos
Message 10 of 13
(7,334 Views)