LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable in A SQL query??

Solved!
Go to solution
Hi,
 
I have got a numeric output value in an inumeric indicator and would like to update one of the values in the MS access table with that numeric value.
 
How to update my MS access table with this numeric indicators value using sql's "update command" ?? If not possible, is there any other way of doing??
 
Seeking some advice to update(don't want to create a new row) an existing row of a particular table.
I am using ver8.5 with DBTOOLS and there is no direct update vi, and is there a way to update the table using existing dbtools??
 
0 Kudos
Message 1 of 7
(3,849 Views)
I don't use the toolkit but surely there is a way to execute a SQL command directly. To use a variable, you can use the Format Into String. Something like 'UPDATE tablename SET columnA = %d WHERE columnB = whatever'. Look through the lower level functions to find where the SQL command is being sent and use that function.
0 Kudos
Message 2 of 7
(3,826 Views)


@Parny wrote:

is there a way to update the table using existing dbtools??

No. As Dennis said, you can call the DB Tools Execute Query VI and give it your SQL query or you can create an update VI yourself based on the insert VI.

___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(3,820 Views)
Hi, thanks for the answers.
 
Actually, I was able to manage my situation through global variables, will be more relieved if you can clarify the belowSmiley Tongue.
 
Please look at the attached vi image which I created for example :
In this simple vi, is it feasible to replace "7" in the update sql query with indicator named "number_output" ?? How do we interrelate datas in these kind of scenarios??
 
--Something like 'UPDATE tablename SET columnA = %d WHERE columnB = whatever'
(How to replace %d with the numeric indicator?)
 
0 Kudos
Message 4 of 7
(3,797 Views)
Solution
Accepted by topic author Parny
Have a look at the Format Into String primitive.

___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(3,791 Views)
Hi Parny,
 
tst is exactly correct. Here is a screenshot of what that code would look like.


Message Edited by lion-o on 11-15-2007 04:40 PM
0 Kudos
Message 6 of 7
(3,767 Views)
Thanks to you all, got clarified now.
0 Kudos
Message 7 of 7
(3,761 Views)