LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unbundle a 2D array of clusters from a database

Solved!
Go to solution

Hello, I have used the DB Tools Fetch Rercordset Data.vi to take data from a database. The data is a (2D array of Clusters). I want to separate them to know the data type of every column in my database. Any help?

0 Kudos
Message 1 of 4
(377 Views)
Solution
Accepted by topic author electronic_lab

Hi,

 

If you want to inspect your database structure, there are useful VIs in sub-palette "Connectivity->Database->Utility" which allows to list tables in a database, columns in a table, get properties, ...

 

"DB Tools List Columns.vi" gives you the columns' types of a table. The types all have equivalents in LabVIEW:

As far as I know:

String -> LabVIEW String

Long (I32) -> LabVIEW I32

Single (SGL) -> LabVIEW SGL

Double (DBL) -> LabVIEW DBL

Date/Time -> LabVIEW Time Stamp

Binary -> LabVIEW String

 

Then with your "recordset data", you can use "Database Variant To Data" and wire the type to convert it to usable LabVIEW types.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 4
(331 Views)

Functions -> Programming -> Cluster, Class, & Variant -> Variant -> Data Type Parsing -> Get Type Information.vi

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 4
(328 Views)

@electronic_lab wrote:

Hello, I have used the DB Tools Fetch Rercordset Data.vi to take data from a database. The data is a (2D array of Clusters). I want to separate them to know the data type of every column in my database. Any help?


Why would you need to "separate them" (I don't even know what that means!) to know the datatypes? In LabVIEW, a cluster is a structure defined at compile time and thus fixed. You can just hover over the terminal and see the types in the context help.

0 Kudos
Message 4 of 4
(326 Views)