LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert cluster into database

Solved!
Go to solution

I am trying to insert a cluster into a SQL database using the database connectivity tools. I get an error (attached). See attached the code I am using

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
Download All
0 Kudos
Message 1 of 15
(3,410 Views)

Looks to me like the string is too long for the string field in the DB.

(You should wire the cluster directly instead of going via ref->property)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 15
(3,393 Views)

Hi Yamaeda

 

The cluster is being wired directly using a local variable it's just the way the code snippet saved it for uploading

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 3 of 15
(3,390 Views)

Then you have a race condition. You cant guarantee the local variable is using the newest or previous value, it's depending on when it updates ... wire directly to make sure.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 15
(3,388 Views)

I wired directly still resulting in the same error

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 5 of 15
(3,384 Views)

Hi,

I could not see your code because I dont have 2013 with me. please check following points

 

1. Please connect column name input

2. Make sure number of elements in cluster equals number of column.

3. make sure data type for each element is properly defined in SQL table, generally assigning text does not cause problems.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
0 Kudos
Message 6 of 15
(3,373 Views)

So, how long text are you sending to the database, and how long it the text field configured?

Can you "make current values default" after a unsuccesful run and post the vi so we can see what you're sending?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 15
(3,372 Views)

I'm using labview to create the table using the insert vi by setting create table to true. If I connect the columns I get error 1 saying the number of columns does not match the the number of parameters

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 8 of 15
(3,366 Views)

I will still suggest to connect column names, and make sure you have equal number of column and elements to be inserted.

 

As error it self is suggesting that number of elements and number of column are not matching, please check that part.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
0 Kudos
Message 9 of 15
(3,359 Views)

If possible share code in LabVIEW 2010 version so that I can take a look.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
0 Kudos
Message 10 of 15
(3,356 Views)