LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the LabVIEW database connectivity VIs write an array to a single cell?

Solved!
Go to solution

Hi Everyone,

 

I'm wondering whether DB Tools Insert Data VI is able to accept an array as it's input data. It's a little hard to tell because whatever you wire to the input of this VI is willingly accepted by the variant data type terminal, so no glaringly obvious broken wires occur when you do wire up an array.

 

What I'm trying to do is write a 2D array of doubles to a single cell in a table. The array is 3x1000 elements large. I admit being completely new to databases and such an effort may or may not sound rediculous in the database world. If anyone wants to talk about why I'm attempting that I'll gladly run through my reasoning - just suffice to say I'm not totally mad.

 

When I try to write said array to a single cell an error occurs as seen in the attached screen shot. All of my other databse functions, which work with scalar values of many different data types, are all working fine.

I've attached the problematic code. It's attempting to write 8 of these arrays to 8 individual columns, all in the same row. I'm just using the "automatic" method at the moment.

Extra tid bit info:
OpenSQL database. Connecting via ODBC 5.2 64bit, User DSN.

LabVIEW 2012 non SP1. Windows 7 64bit.


Thanks all!
Rhys.

Download All
0 Kudos
Message 1 of 4
(2,974 Views)
Solution
Accepted by topic author CrashitFixit

Convert the array to a spreadsheet string and store it that way.

 

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 4
(2,962 Views)

Thanks for the reply - learnt a new function today!

It turns out the strings produced are too big for a single cell to handle - as such I'm going to have to rethink my DB archtiecture a little. That said, still a perfect fix for whenever you're trying to write less than about 3000 characters per cell 🙂

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

What DB architecture are you using?  If you are using MSSQL, varchar(max) can store up to 2GB of data in one cell. 

 

http://msdn.microsoft.com/en-us/library/ms176089.aspx

 

If you are using MySQL, the longtext datatype can store up to 4,294,967,295 characters.

 

http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 4
(2,929 Views)