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: 

Rookie Labview Question

Solved!
Go to solution

Hello again,

 

I'm trying to modify one row in my database VI, and have been having difficulty.

 

The first image (modifysimplesingle) shows the update database working properly, however i don't want to just change one column value. I read the help document on the update data VI, which led me to believe it's possible to input a cluster to update the entire row.

 

So i attempted this (modifysimplecluster), and have yet to achieve success. Am i misreading this? I also looked at the example provided by Labview, copying their syntax. If i am wrong, what would be the best way to modify a single row, provided that there are primary keys, and foreign keys at times (If that makes a difference).

 

Download All
0 Kudos
Message 1 of 4
(3,245 Views)
Solution
Accepted by topic author StavA

It looks like you're providing the data but not the names of the columns. Provide a string array to input columns so that the function knows which columns to apply the data to.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


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

Indeed, i saw my mistake a few minutes earlier. I kept trying to wire no column input as i thought it worked similiar to inserting a new entry into the table, where if you don't specify a column but input a cluster it updates every column in that row. Thanks for your reply!

0 Kudos
Message 3 of 4
(3,203 Views)

The first problem I see is you have quotes around your userid.  If your userid values are indeed numeric, do not use strings.  String comparison takes much longer to complete.

 

Next, it might be easier to understand what your doing if you format your own SQL query like this and use the Execute query VI:

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 4
(3,201 Views)