Showing results for 
Search instead for 
Did you mean: 

INSERT, UPDATE and SELECT data of cluster to/from DB


I have cluster of same data. This cluster/data I want save to Database. For this I use INSERT or UPDATE. Table column for this cluster is Binary type.

I SELECT this cluster/data from DB, but is it OLE Variant type. In Variant Indicator I can see:
   OLE Variant

   Variant Type -> VT_ARRAY|VT_UI1
   Value -> Array(Non Displayable)

How can I convert OLE Variant data (array of U8) back to cluster of my type? When I use 'Variant to Data' with my original cluster LabVIEW return Error -2147352571 ;-(


P.S.: I can not use cluster -> XML because in this cluster will be LabVIEW types and binary data [Images, etc.]
0 Kudos
Message 1 of 2
OK, thank you Vlado

We found solution:

I can convert may cluster/variant with 'Flatten To' to string. This string I save to DB.

After this string I can convert from DB Variant to string and after from string to original cluster/variant by 'Unflatten From'

It is working well. You can save to DB cluster with IMAQ Images.

I recommend use small table with 'cluster_ID'[int] and 'string_data'[text] ::: "Because SQL Server stores text/ntext columns on the Text/Image pages separately from the other data, stored on the Data pages, it can take more time to get the text/ntext values."

More details:
0 Kudos
Message 2 of 2