LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adjust data in database with variables

Solved!
Go to solution

Good morning,

 

For my internship I have an assignment to read out, and adjust a database with variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables, and to make the user able to adjust the write variables. The first part was "easy" because the forum contained a lot of examples about this subject. The second part is more difficult because the forum contains absolutely no examples about this subject. I can use LabVIEW 2010, and 2011, and also I have downloaded the thirty day trial of the database connection toolkit. If it is useful, I can advise my company to buy this package. The read vi makes use of an UDL (Microsoft data link) connection.

 

So my question to you guys is: Is it possible to adjust specific variables in a database by using LabVIEW? And maybe you can give me a little advice about how to do this...

 

Thanks ahead!

 

Roy

0 Kudos
Message 1 of 7
(2,910 Views)

You can easily perform a SQL Update query through LabVIEW, which'll adjust data.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

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

Ok, but can you tell me which subvi I should use for that? Am I also able to adjust specific data?

 

Thanks for the reaction!

 

Roy

0 Kudos
Message 3 of 7
(2,886 Views)
Solution
Accepted by topic author RSO

In SQL the specific data is always selected with the WHERE keyword. In the Update VI there's a connection for options, you can e.g. add a constant "WHERE id=1457 and measurement > 0.54"

You can ofc. also build that string through controls, parameters and other ways.

If you prefer you can use the Execute query (under advanced sub-tab i think) to which you can send the complete query e.g. "Update TestTable set name='Zeus' where id> 14 and id < 57"

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 7
(2,882 Views)

Thanks a lot!

I'll give it a try today!

 

Roy

0 Kudos
Message 5 of 7
(2,870 Views)

It works well!

I can now construct a query with the concatenade string function,

so the user only has to fill in the data-id which has to be changed!

 

Thanks again,

 

Roy

Message 6 of 7
(2,863 Views)

Great, thanks for the feedback.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

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