 |
|
| Computers Forum Index » Computer - Databases - IBM DB2 » Export blob to JPG... |
|
Page 1 of 1 |
|
| Author |
Message |
| brunoalsantos... |
Posted: Thu Oct 15, 2009 8:05 pm |
|
|
|
Guest
|
Hi all,
DB2 LUW 9.5 Fp 3a.
I have a table T with a column type blob.
Can I export this blob transforming directly to a JPG file?
Thanks in advance. |
|
|
| Back to top |
|
|
|
| Ian... |
Posted: Fri Oct 16, 2009 1:24 am |
|
|
|
Guest
|
brunoalsantos wrote:
Quote: Hi all,
DB2 LUW 9.5 Fp 3a.
I have a table T with a column type blob.
Can I export this blob transforming directly to a JPG file?
As far as the database is concerned, a blob is just a stream of
bits. DB2 doesn't "transform" data from one format to another.
Now, if the data that exists in the column is already JPG data,
and you're just asking how to write the data it into a file,
you're probably going to want to write a quick program. The
EXPORT utility will not extract LOB data writing one file
per row (that is unless your export only matches a single row!).
You can write a quick program to do this in C or even a scripting
language like perl or ruby. |
|
|
| Back to top |
|
|
|
| brunoalsantos... |
Posted: Fri Oct 16, 2009 11:56 am |
|
|
|
Guest
|
On 15 out, 18:24, Ian <ianb... at (no spam) mobileaudio.com> wrote:
Quote: brunoalsantos wrote:
Hi all,
DB2 LUW 9.5 Fp 3a.
I have a table T with a column type blob.
Can I export this blob transforming directly to a JPG file?
As far as the database is concerned, a blob is just a stream of
bits. DB2 doesn't "transform" data from one format to another.
Now, if the data that exists in the column is already JPG data,
and you're just asking how to write the data it into a file,
you're probably going to want to write a quick program. The
EXPORT utility will not extract LOB data writing one file
per row (that is unless your export only matches a single row!).
You can write a quick program to do this in C or even a scripting
language like perl or ruby.
Ok Ian.
A analyst from my development team will write this program.
Thanks for your answer.
- Bruno |
|
|
| Back to top |
|
|
|
| Joachim Klassen... |
Posted: Fri Oct 16, 2009 12:13 pm |
|
|
|
Guest
|
On Oct 16, 1:56 pm, brunoalsantos <brunoalsan... at (no spam) gmail.com> wrote:
Quote: On 15 out, 18:24, Ian <ianb... at (no spam) mobileaudio.com> wrote:
brunoalsantos wrote:
Hi all,
DB2 LUW 9.5 Fp 3a.
I have a table T with a column type blob.
Can I export this blob transforming directly to a JPG file?
As far as the database is concerned, a blob is just a stream of
bits. DB2 doesn't "transform" data from one format to another.
No need to write a program . Use export with this clause: MODIFID BY
LOBSINSEPFILES. This will write each lob to a seperate file. The
filename will be build with an extension of *.lob, so simply rename
them after export to *.jpg
Quote:
Now, if the data that exists in the column is already JPG data,
and you're just asking how to write the data it into a file,
you're probably going to want to write a quick program. The
EXPORT utility will not extract LOB data writing one file
per row (that is unless your export only matches a single row!).
You can write a quick program to do this in C or even a scripting
language like perl or ruby.
Ok Ian.
A analyst from my development team will write this program.
Thanks for your answer.
- Bruno |
|
|
| Back to top |
|
|
|
| Ian... |
Posted: Sat Oct 17, 2009 3:46 am |
|
|
|
Guest
|
Joachim Klassen wrote:
Quote: On Oct 16, 1:56 pm, brunoalsantos <brunoalsan... at (no spam) gmail.com> wrote:
On 15 out, 18:24, Ian <ianb... at (no spam) mobileaudio.com> wrote:
brunoalsantos wrote:
Hi all,
DB2 LUW 9.5 Fp 3a.
I have a table T with a column type blob.
Can I export this blob transforming directly to a JPG file?
As far as the database is concerned, a blob is just a stream of
bits. DB2 doesn't "transform" data from one format to another.
No need to write a program . Use export with this clause: MODIFID BY
LOBSINSEPFILES. This will write each lob to a seperate file. The
filename will be build with an extension of *.lob, so simply rename
them after export to *.jpg
Ooh! Thanks! I hadn't noticed that feature in the 9.5 docs yet.
Very handy! |
|
|
| Back to top |
|
|
|
| Mark A... |
Posted: Sat Oct 17, 2009 8:09 am |
|
|
|
Guest
|
Quote: "Joachim Klassen" <JoKlassen at (no spam) email.com> wrote in message
news:cec73553-bc74-4e02-8ea7-8f836bd66e71 at (no spam) a31g2000yqn.googlegroups.com...
No need to write a program . Use export with this clause: MODIFID BY
LOBSINSEPFILES. This will write each lob to a seperate file. The
filename will be build with an extension of *.lob, so simply rename
them after export to *.jpg
There is shareware program that will read DB2 and let you view LOB files
that are jpg's or other common viewable format, and then save them to your
local machine. I think it also plays audio files stored as LOBs. I forgot
the name, but I suspect you could find it with a search engine. |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Tue Dec 15, 2009 7:05 am
|
|