LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DB Connectivity Toolkit Insert Data: Error -2147352567

Solved!
Go to solution

I can connect to our local Oracle database, read data from and existing table, but

when I try to create a table and insert data, no success 😞

 

Please see the attachments for full error code and a picture of the block diagram.

 

 

Download All
0 Kudos
Message 1 of 31
(7,400 Views)

SInce the query works fine, a best guess would be that the user account does not have sufficient privilege to create a table in the database. 

0 Kudos
Message 2 of 31
(7,393 Views)

Thanks.

 

I am actually abe to create tables and insert data into them using SQL statements with Golden6.

 

The space in the Oracle database was created for me and I have full read/write access.

 

I don't think this is a question of permission.

 

0 Kudos
Message 3 of 31
(7,373 Views)

"data" needs to be a cluster if you do not specify the columns input. If the array elements are in the order of the database columns you can use the "array to cluster" function.

=====================
LabVIEW 2012


0 Kudos
Message 4 of 31
(7,365 Views)

I created the table mytable separately. I can see it exists in the database.

It has two columns title A, B.

 

I want to insert the values a, b in each column. I converted my data into a cluster.

 

Attached is the VI.

 

It gives me the same error.

0 Kudos
Message 5 of 31
(7,352 Views)

Did you create the table using the database connectivity toolkit insert vi by setting create table to true or did you create it by some other means?

 

Rather than using array to cluster just create a cluster control and wire that to data. You can leave the columns input to insert empty but make sure that the order of the items in the cluster is correct by using the reorder tool.

=====================
LabVIEW 2012


0 Kudos
Message 6 of 31
(7,347 Views)

I created the table using DB Toolkit Vi Create table.

 

I can write-click on the Data input of the Insert VI and create Control. This simply puts a empty box

called data in my front panel. How do I populate this empty box with just two columns and 1 row.

 

My whole goal right now is to be able to insert something in the table. My actual data is in an Excel sheet with a few columns and rows.

I can try to read my spreadsheet data, use bundle, or whatever, and convert that to a cluster, and then feed it to the data input.

But that is a second step.

 

BTW, reading the help menu on Insert VI indicates the data does not have to be a cluster. I just have to make sure the data type

I am putting in the table matches the column data type of the table, and that if my table has two columns, that I put in exactly two

columns of data.

 

This is such a simple task.

0 Kudos
Message 7 of 31
(7,342 Views)

The data input is a variant so you can not right click to create a cluster. You have to put a cluster shell down on the front panel then add controls. Are they all string controls?

 

If the data input is not a cluster, the way I read it, it is only one column to be inserted and that column is specified in the first element of the columns array. If you wire an array of more than one element to columns then these specify the columns that the cluster elements will be inserted into. Array element 0 is the column that the first cluster item is inserted, element 1 is the column that the second cluster item is inserted into, etc. If a cluster is wired to data and columns is unwired then the first cluster element will be inserted into the first column, second cluster element into the second column, etc. The order of the columns being the order in which they were defined when you created the table.

 

To insert multiple rows you would have an array of clusters and put the insert function in a loop.

=====================
LabVIEW 2012


0 Kudos
Message 8 of 31
(7,333 Views)

I tried that it didn't work. Got the exact same error.

 

I know you don't have to do this, but I certainly appreciate your effort to try to help me.

 

Would you take my VI from the link above and just create a cluster of two columns and 1 or two rows?

 

 

0 Kudos
Message 9 of 31
(7,328 Views)

You don't create a cluster of two columns and some number of rows. You create a cluster of items then create an array of clusters.

 

Try this. (I attached the VI in LabVIEW 8.0 format)

 

Insert Rows.png

 

 

=====================
LabVIEW 2012


0 Kudos
Message 10 of 31
(7,325 Views)