LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database connectivity toolkit

Hello,

 

always when my table has more than one column my query return an "Object 0x000000 is not valid." error.

I have tested the query in the MySQL workbench and it works, also when the table has more than 1 column..

 

The query: update mytable set mytable.row5 = (select row1+row2+row3+row4);

 

Why the query works for a table with 1 column, but not for a table with x columns?

 

Thanks in advance!

 

Best regards,
Stefan

0 Kudos
Message 1 of 4
(2,363 Views)

Give an example of data before and after the query to show what you want.  You can't select row1 + row2 like you are doing unless your columns are named row1, row2 (which makes no sense). 

Your query should be:

UPDATE mytable
SET row5 = row1 + row2 + row3 + row4
WHERE condition

2019-03-26_12-21-00.png

aputman
0 Kudos
Message 2 of 4
(2,326 Views)

"The WHEREclause is optional. If you omit the WHERE clause, the UPDATE statement will update all rows in the table."

That is what I want, it works when I try the query in the mysql command line.

With the labview db query execute query it works only for a table with 1 column but not for tables with more than 1 columns.

I also tried a mysql procedure with a while loop with the same result.

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

Yes the WHERE clause is optional. Did you use my query without the WHERE clause?  Mine is different than yours in that you have an additional SELECT that doesn’t make sense. Show us the exact query that you are using. 

aputman
0 Kudos
Message 4 of 4
(2,302 Views)