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)
|
![]() |
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
|
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?!
|
||
|
|
|||
| Ad |
Apr 9 2006, 06:35 PM
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 ,. ,.
My Blog
|
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) -------------------- ![]()
|
||
|
|
|||
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
|
... (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) *************************************************************
|
||
|
|
|||
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
|
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!
|
||
|
|
|||
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
|
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.
|
||
|
|
|||
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 ,.
|
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?
|
||
|
|
|||
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 ,. ,.
|
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?
|
||
|
|
|||
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
|
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.
|
||
|
|
|||
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 ,.
|
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!
|
||
|
|
|||
![]() ![]() |
| Time is now: 8th January 2009 - 07:33 PM |