LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our Database and File IO Code Repository Files or visit the LabVIEW Wiki Database and File IO articles.


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> How to store pictures in a Oracle database using labview
Ad Dekkers
post Apr 9 2006, 06:35 PM
Post #1


Active
*

Member
Posts: 14
Joined: 27-March 06
From: Netherlands
Member No.: 4574
Using LabVIEW Since:1996
LV:8.20 ,7.1.1 ,6.1
Netherlands Belgium Nothing Selected


Hello,

I am using the Database connectivity toolset to store test- and quality data into a oracle database.
But i also want to store complete pictures in this database.
Can anyone tell me how to do this?! book.gif worshippy.gif


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Apr 9 2006, 06:35 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
crelf
post Apr 9 2006, 10:28 PM
Post #2


I'm a LAVA, not a fighter.
******

V I Engineering, Inc.
Posts: 3851
Joined: 13-October 03
From: Michigan, USA
Member No.: 181
Using LabVIEW Since:1993
LV:8.5 ,. ,.
Australia United States Nothing Selected My Blog


QUOTE (Ad Dekkers @ Apr 10 2006, 04:35 AM) *
I am using the Database connectivity toolset to store test- and quality data into a oracle database.
But i also want to store complete pictures in this database.

The datatype you want is called a "Long Raw" in Oracle (in most other SQL lands it's called a "Blob" or a "Binary Blob") and it's basically just a binary chunk. Try Googling it for more info... (note: my experience has shown large amounts of data in an array in Blob format can be slow and can cause the database to grow disproportionally to the size of the data you insert - you might want to consider keeping the images outside of the database and having a simple text field to point to its location)

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Mike Ashe
post Apr 10 2006, 03:03 AM
Post #3


Instant Human, just add coffee
****

Premium Member
Posts: 889
Joined: 31-January 03
From: Waterford, CT USA
Member No.: 45
Using LabVIEW Since:1992
LV:8.2.1 ,7.1 ,8.0.1
United States us_connecticut us_washington


QUOTE (crelf @ Apr 9 2006, 06:28 PM) *
... (note: my experience has shown large amounts of data in an array in Blob format can be slow and can cause the database to grow disproportionally to the size of the data you insert - you might want to consider keeping the images outside of the database and having a simple text field to point to its location)
I agree completely. If you are storing anything other than very small thumbnails, you should store imaging data or 2D arrays external to the database and give indexes or file names/paths.

The downside of that is that you need sometime of trigger/procedure to handle times when a file is not there, moved, etc, and obviously more files, etc.

--------------------
*************************************************************
"Always listen to the experts, they'll tell you what can't be done, and why.
Then go do it."
~The Notebooks of Lazarus Long (by Robert Heinlein)
*************************************************************


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad Dekkers
post Apr 15 2006, 12:47 PM
Post #4


Active
*

Member
Posts: 14
Joined: 27-March 06
From: Netherlands
Member No.: 4574
Using LabVIEW Since:1996
LV:8.20 ,7.1.1 ,6.1
Netherlands Belgium Nothing Selected


QUOTE (crelf @ Apr 10 2006, 12:28 AM) *
The datatype you want is called a "Long Raw" in Oracle (in most other SQL lands it's called a "Blob" or a "Binary Blob") and it's basically just a binary chunk. Try Googling it for more info... (note: my experience has shown large amounts of data in an array in Blob format can be slow and can cause the database to grow disproportionally to the size of the data you insert - you might want to consider keeping the images outside of the database and having a simple text field to point to its location)


Sorry for my late response, but i was away to France for some days.
I know what kind of field to use and that the database will grow a lot, but what i don't know is how to store the picture (or other BLOB like data) into the database using labview tools.
I can't use a simple "insert into" statement i think, but i can't find a vi that does the job!


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
xtaldaz
post May 3 2006, 06:47 PM
Post #5


Very Active
***

Member
Posts: 88
Joined: 5-April 04
From: Flagstaff, AZ
Member No.: 342
Using LabVIEW Since:1989
LV:8.2.1 ,8.5 ,7.1.1
United States us_arizona us_utah


QUOTE (Ad Dekkers @ Apr 15 2006, 07:47 AM) *
Sorry for my late response, but i was away to France for some days.
I know what kind of field to use and that the database will grow a lot, but what i don't know is how to store the picture (or other BLOB like data) into the database using labview tools.
I can't use a simple "insert into" statement i think, but i can't find a vi that does the job!


I can only answer your question with another question -- what format is this picture in LabVIEW? The way the Database Toolkit was written, any datatype that doesn't have a direct equivalent to a database datatype gets written as a BLOB (exactly what you want). So if you have the picture as a 2D array, a picture control, or similar, you can just use the Insert Data VI and wire that to the input. Or you can use a parameterized query and just wire in that 2D array or picture or whatever into the value input of the Set Parameter Value VI for a field defined as binary.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Rammer
post Aug 28 2008, 01:26 PM
Post #6


Enough LAVA to be dangerous


Member
Posts: 4
Joined: 18-March 08
Member No.: 11089
Using LabVIEW Since:1998
LV:8.5 ,8.2.1 ,.
United States United States Nothing Selected


QUOTE (xtaldaz @ May 3 2006, 01:47 PM) *
I can only answer your question with another question -- what format is this picture in LabVIEW? The way the Database Toolkit was written, any datatype that doesn't have a direct equivalent to a database datatype gets written as a BLOB (exactly what you want). So if you have the picture as a 2D array, a picture control, or similar, you can just use the Insert Data VI and wire that to the input. Or you can use a parameterized query and just wire in that 2D array or picture or whatever into the value input of the Set Parameter Value VI for a field defined as binary.



I have been trying to put BLOB data into a SQL database with the parameterized query for a stored procedure. I choose the binary data type, however at some level NI must be converting to a string, because it limits me on how big this blob can be (to a very small value < 1000 data points). Has anyone overcome this?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Omar Mussa
post Aug 28 2008, 03:05 PM
Post #7


Very Active
***

JKI
Posts: 151
Joined: 3-August 06
From: San Francisco, CA
Member No.: 5746
Using LabVIEW Since:1996
LV:8.20 ,. ,.
United States us_california Nothing Selected


QUOTE (Rammer @ Aug 28 2008, 06:26 AM) *
I have been trying to put BLOB data into a SQL database with the parameterized query for a stored procedure. I choose the binary data type, however at some level NI must be converting to a string, because it limits me on how big this blob can be (to a very small value < 1000 data points). Has anyone overcome this?


I worked on a project in the past that used an Oracle database and we found that we couldn't write more than 1000 points either so we basically broke up our data into chunks of 999 points. I didn't like the solution because it made it hard to get the data back (had to join multiple rows from the same results table), but it worked.

On a side note, there's another issue that is sort of related that you can sometimes run into - I think there is a limit to how long of an SQL string you can execute using the ADO based toolkit VIs so you might want to be aware of that as well. I don't recall what the string length limit is.

--------------------
got VIPM?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
xtaldaz
post Aug 28 2008, 03:25 PM
Post #8


Very Active
***

Member
Posts: 88
Joined: 5-April 04
From: Flagstaff, AZ
Member No.: 342
Using LabVIEW Since:1989
LV:8.2.1 ,8.5 ,7.1.1
United States us_arizona us_utah


At one point, there was a bug in the ODBC drivers for Oracle that limited the size string (or BLOB) you could write at one time. However, with the OLE DB Provider for Oracle, I was able to write 8 MB BLOBs of data (maybe more, I honestly can't remember anymore - it was in the CAR) with no problems. I kept writing bigger and bigger BLOBs to an Oracle table until I ran out of memory. So I recommend checking what driver you are using for your data communication through ADO.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Pjotr
post Sep 12 2008, 02:57 PM
Post #9


4 more posts to go!


Member
Posts: 6
Joined: 31-March 06
From: Oss, the Netherlands
Member No.: 4617
Using LabVIEW Since:1997
LV:8.5 ,7.0 ,.
Netherlands United Kingdom Nothing Selected


That's right indeed: The DB Tools Insert Data.vi and DB Tools Select Data.vi (LabVIEW 8.5 + database toolkit) work absolutely fine if you use the 'Oracle Provider for OLE DB', but not with the 'Microsoft OLE DB Provider for ODBC Drivers', which not goes beyond a rediculous 1000 bytes or so. Oracle database entry of files and images from LabVIEW made very easy!


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 8th January 2009 - 07:33 PM