12-27-2023 05:00 AM
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?
Solved! Go to Solution.
12-27-2023 09:34 AM - edited 12-27-2023 09:57 AM
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.
12-27-2023 09:36 AM
Functions -> Programming -> Cluster, Class, & Variant -> Variant -> Data Type Parsing -> Get Type Information.vi
12-27-2023 09:39 AM
@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.