LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to input data in a database table without knowing in advance table and column configurations

Hi,

 

I have a problem using LabVIEW for input data (manually) in a SQL database. I have about 40 tables in the database, each of them is related to a specific engine component. I need to create a user interface (maybe visualizing the table with a table control) where the users can insert data in the database table fields. Could someone give me some suggestion on how to do it?

 

Using the  DB tools insert data.vi I need to know in advance the column configuration of the table, but in my database each table has its own structure! So do I have to create 40 different masks, one for every different table?

 

Thanks in advance.

 

Michela

 
0 Kudos
Message 1 of 4
(2,680 Views)
Could you not query the table and return the number of fields and data types, then construct a table in your user interface, Then use the same data to insert entries into the tables in the database?
_____________________________
- Cheers, Ed
0 Kudos
Message 2 of 4
(2,671 Views)

It was what I tried to do but I wasn't able to program. I know how to get column informations (as an array of clusters: column name, type of data, size), but after that I am not able to use those info for insert entries in the table...

Can you give me some suggestions?

Thanks

Michela 

0 Kudos
Message 3 of 4
(2,664 Views)

I have not actually used the LV SQL Toolkit, but I will try and offer high level ideas 🙂

 

when you have retrieved the construction data for a table, you should be able to use array and cluster indexing to aquire the names of the fieds, enough to create a labelled table on the LV Front panel.

 

After completing a new entry you can INSERT the entry into the database using the same data.

 

Is the SQL toolkit an additional purchase, or included in newer versions as standard? If you post a sample of the cluster/array that you retrieve, I could give you a sample VI to give you some pointers in creating the User Interface table 

 

_____________________________
- Cheers, Ed
0 Kudos
Message 4 of 4
(2,649 Views)