LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL in LabVIEW and Oracle involving BLOB datatypes

I'm using the new Database Connectivity Toolset to communicate with an Oracle 8i database. I'm very used to generating my own SQL statements (SQL Toolkit 5.0), so I've avoided using the built in VI's that translate an array of column names and corresponding values to an SQL statement. However I don't know how to write a SQL statement (in LabVIEW) that will INSERT or SELECT binary data to or from an Oracle8i column of BLOB datatype. Essentially, I want to take a large 2D array of data, convert it to binary and write to this BLOB column...then retrieve it at a later point.

Thanks!
0 Kudos
Message 1 of 6
(3,938 Views)
I'm not quite sure where your having the problem. In the new Database toolset, there are still the Advanced VI's if you want to input queries yourself. I had no trouble taking a 2D array, flattening it to a string and inserting it into a BLOB dataype, or retrieving it later. Where exactly are you having trouble?
0 Kudos
Message 2 of 6
(3,940 Views)
Well, it's hard to tell. I know "something" is making its way into the database (the number or records each time I perform an INSERT), but given the nature of the datatype, I can't view what's being dropped in the column. Similarly, when I query that column for the value I just INSERTed, I extract "blank" data. By "blank" I mean that the query actually extracts something, but populates my array (string array at this point) with blanks...which I suppose is better than an empty array. So to answer your question, I'm not entirely sure "where" the problem is occurring.

I'm aware the new toolset still allows you to enter your own SQL statement. But I have absolutely no idea how to write an "INSERT INTO" statement that contains binary data (especially when
the flattened 2-D array is "technically" still a string).

Any additional information you could provide regarding code, database version, etc. would be MORE than appreciated. Is it possible that I could get you to attach a simple piece of code (even a screenshot would be fine) to illustrate what you have? It doesn't sound too complicated, given all the variations I've tried. Perhaps it's a database setting?

Thanks again!

-Chris
0 Kudos
Message 3 of 6
(3,938 Views)
I apologize. I just tried it real quick before with a single number to a BLOB. I tried it again actually using a 2D array and am having issues myself.
0 Kudos
Message 4 of 6
(3,938 Views)
A single number (at this point) is far much more than I've been able to accomplish. Anything will do!

Thanks!

-Chris
0 Kudos
Message 5 of 6
(3,938 Views)
Instead of using the Database Connectivity Toolset, you might want to try Oracle Objects for OLE (oo4o). This is a set of COM objects written by Oracle specifically for Oracle databases, and supports datatypes that are specific to Oracle. Have a look. It's a free download from Oracle. Search their website for oo4o or Objects for OLE. You should find it.

Gino
0 Kudos
Message 6 of 6
(3,938 Views)