LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to set up a database using the database connectivity toolkit and 8.5. I have tables setup and each one has an autoincrementing primary ID key.

I have very little experience with databases, but I have to set one up. I am setting up a relational BD, I have several tables set up, each has a primary key set up as a ID, autoincrement.
 
How can I not send this column data, and let it autoincrement like it should so that it is a unique entry. I keep on getting an error that says that the number of colums don't match. Is there any way to do this.
 
I want the database to keep track of the line count for this, and increment when each new entry arrives.  Does this make any sense?
0 Kudos
Message 1 of 4
(2,715 Views)
The insert data VI has a Columns input which is a 1D string array. Each element in the array corresponds to an element in the cluster, so you can just use the names of the columns and not use the ID column.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,705 Views)
I think that is what I was doing, but it did not like it, I kept getting an error saying that the array that I was sending did not have the same number of columns as the table I was sending it to. When I read the database and list out the tables and the columns, I see that ID as one column in each table. That is my problem, It seems like I have to define each element and I have to send the same number of elements as there are in the table. I am using that as the primary key so I can not by definition send that a null, it has to be unique.  
0 Kudos
Message 3 of 4
(2,691 Views)


questionable wrote:
It seems like I have to define each element and I have to send the same number of elements as there are in the table.

No, the cluster and the Columns array must have the same number of elements (the help for the VI even says that) and they need to include all columns which don't allow nulls. The ID column is probably auto-incrementing. You can't insert it and you're not supposed to.

___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,675 Views)