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.
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.
08-28-2017 10:13 AM
Hello,
I am using the Database connectivity toolkit that comes with LabView 2017. I am trying to insert data into a SQL database table. Right now, LabView successfully connects to the database, but when it goes to insert data I get the error "Error 1... the number of columns does not equal the number of parameters." I seen much older threads with this issue but without any real solutions. As you can see from the attachments, the columns in LabView match the database column headers exactly, and the VI only wants 1-D array strings (previous threads suggested using clusters). Any help on this issue would be greatly appreciated. I'm kind of banging my head against the wall at this point.
Thank you,
Matt
Solved! Go to Solution.
08-29-2017 08:30 AM
Can this somehow be related to the data type you have as in "Data" As far as I see at the help of DB Tools Insert Data VI "data" does not seem to be an array?
08-29-2017 08:36 AM
That's a good point, but yesterday I tried entering data as a string cluster, and then as I cluster with I32 numbers and still got the same error. Both with a "True" constant wired into "flatten cluster" but both these types gave me the same error.
08-29-2017 08:38 AM
Please move this discussion to the LabVIEW forums.
This forum is for LabVIEW Communications.
Thanks!
08-29-2017 08:44 AM
Ok, I'm not quite sure how to do that though.
08-29-2017 01:46 PM
I can't open your 2017 VI but are you sure you're not trying to write to an ID (primary key) column that the database is set to auto-increment?
09-05-2017 08:04 AM
I figured it out with the help of one of the database guys at my work. So that you guys can spread the word if you see this again, the issue was that when the SQL database is created, each column is given a specified type. In LabView, you must make sure that the type of the data you are inputting for that column matches what SQL is expecting. Also, each column you input should be entered into a bundle which is then wired to the "data" part of the VI.
09-06-2017 09:09 AM
Thanks for reporting back after you figured it out.