Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2006

Tip: Looking for answers? Try searching our database.

DB2 Image Extenders

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
yoyo - 21 Feb 2006 19:07 GMT
Ok, I think I just may be a moron, but where the heck are the Image
extenders found? I've look all around, tried all the DB2 cd's I have,
are they installed by default somewhere? Which install fileset (AIX) are
they part of?
The CD's only show spatial and xml extenders?
Knut Stolze - 21 Feb 2006 19:30 GMT
> Ok, I think I just may be a moron, but where the heck are the Image
> extenders found? I've look all around, tried all the DB2 cd's I have,
> are they installed by default somewhere? Which install fileset (AIX) are
> they part of?
> The CD's only show spatial and xml extenders?

The AIV webpages state that it is bundled with several editions of DB2.  You
happen to have one of those?
http://www-306.ibm.com/software/data/db2/extenders/aiv/prodbundle.html

Related, but different question: what do you have in mind with this
extender?
You have to remember that it is based on 8-10 year old technology and maybe
this is a better alternative?  http://tinyurl.com/q4zpn

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

yoyo - 21 Feb 2006 20:03 GMT
>>Ok, I think I just may be a moron, but where the heck are the Image
>>extenders found? I've look all around, tried all the DB2 cd's I have,
[quoted text clipped - 10 lines]
> You have to remember that it is based on 8-10 year old technology and maybe
> this is a better alternative?  http://tinyurl.com/q4zpn

I see that page, I look at my media, and it's not there.
I have every DB2 8.1 & 8.2 edition out there (enterprise is what I have
actually installed).  It's not called out on any filesets on any of the
install media.

I've come across that page many times now, nice stuff, but unless I
missed something (and that's possible) it deals with blobs already
existing in the database, which I have yet to accomplish. It doesn't say
anything about how to insert those blobs.

What do I have in mind? Well, since you ask....I want to store an image
from a file into a blob from with php code using odbc. There's known
issues with php&db2 trying to insert and retrieve blob (they both point
the blame on the other and the issue is still open, from 2002). So next
I wanted just to try shell_exec a command line insert to insert a blob
from a file.
It doesn't even have to be a blob, I try to use clob and convert my
image before insert....blah..blah...many tries, mostly ending up with
only 4k of the image coming back out.

I just need to store small thumbnail images in the database. I'm going
crazy here. 2 day on this. 2 DAYS!!!!!!

  Is there a better way? I've searched for the last 2 days on this, and
nothing. Everything points to the DB2 image extenders, which I havn't
tried yet.
Knut Stolze - 21 Feb 2006 20:49 GMT
> What do I have in mind? Well, since you ask....I want to store an image
> from a file into a blob from with php code using odbc. There's known
> issues with php&db2 trying to insert and retrieve blob (they both point
> the blame on the other and the issue is still open, from 2002).

You are probably referring to the old odbc-php driver that was used to talk
to DB2.  This was not quite acceptable code.  For example, there was no
support for LOBs at all.  (It is definitively a PHP issue.)  You should
rather stick with the newer Zend Core for IBM that handles stuff properly:
http://www-306.ibm.com/software/data/info/zendcore/

> So next
> I wanted just to try shell_exec a command line insert to insert a blob
> from a file.
> It doesn't even have to be a blob, I try to use clob and convert my
> image before insert....blah..blah...many tries, mostly ending up with
> only 4k of the image coming back out.

Those 4K might be the result from the truncation done by the DB2 CLP.  The
whole LOB might actually be stored in the row.

>    Is there a better way? I've searched for the last 2 days on this, and
> nothing. Everything points to the DB2 image extenders, which I havn't
> tried yet.

Unless you need some sort of image processing, the extender won't help you
either.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

yoyo - 21 Feb 2006 21:07 GMT
>>What do I have in mind? Well, since you ask....I want to store an image
>>from a file into a blob from with php code using odbc. There's known
[quoted text clipped - 23 lines]
> Unless you need some sort of image processing, the extender won't help you
> either.

Zend core. There's something I've not come across. I really wonder if it
will help me though, to store that image in a DB2 database.
The UDF I wanted from the image extender is the DB2IMAGE one, which
allows someone to do this from a command line:

insert into mytablewithblobcolum (CHARATT1,BLOBATT2) values
('ken',DB2IMAGE('/tmp/myjpg.jpg','jpg','26k'))

and it's supposed to take that jpeg and put it in your blob column.

If I have a true blob in there, I'm able to get it out with php odbc.
(I had to use the db2 import function to populate something in that
database with a blob though, I really don't want to use that as a
solution however)
I've never had a problem with odbc connector for db2 in php (until now),
been using for 3 years. I didn't even know of the zend core that IBM wrote.
I'll check out the code and see what's there. Is there native support
for blob then???? Hopefully....

Anyway, thatnks for the help, it's hope anyway,

ANy idea where those DB2 IMage extensions are in 8.1 or 2???????

Ken
Serge Rielau - 22 Feb 2006 14:15 GMT
>>> What do I have in mind? Well, since you ask....I want to store an image
>>> from a file into a blob from with php code using odbc. There's known
[quoted text clipped - 52 lines]
>
> Ken
Watch out for an article on BLOB in PHPs by Helmut Tessarek in the next
issue of php|architect magazine.

Cheers
Sege

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Knut Stolze - 22 Feb 2006 15:45 GMT
> Zend core. There's something I've not come across. I really wonder if it
> will help me though, to store that image in a DB2 database.
[quoted text clipped - 5 lines]
>
> and it's supposed to take that jpeg and put it in your blob column.

To be more precise, it takes an image that resides in a file in the file
system and stores it in the BLOB column.  But that BLOB column exists in a
so-called side table and not your normal user table.  Only a
reference/handle is stored in the user table.

If you want to go that route, I recommend that you have a look at the
article I cited as the Download includes a UDF "SI_loadImage" that does
exactly what you want with much less overhead.  (You can also implement
something like this in Java if you like.)

> If I have a true blob in there, I'm able to get it out with php odbc.
> (I had to use the db2 import function to populate something in that
> database with a blob though, I really don't want to use that as a
> solution however)

You don't have to go over the file route.  You can directly insert a BLOB
send from the client into the database.  Here is a sample PHP script that
does just that:

http://tinyurl.com/r3oqg

Note that the script is still based on the old PHP ODBC driver, but that
driver was heavily modified.

And here is a script to extract BLOBs and send them (as PDF) to the client:
http://tinyurl.com/odcwf

> I've never had a problem with odbc connector for db2 in php (until now),
> been using for 3 years. I didn't even know of the zend core that IBM
> wrote. I'll check out the code and see what's there. Is there native
> support for blob then???? Hopefully....

Yes, BLOB support is there (besides that a lot of other bugs don't exist
there).

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

yoyo - 22 Feb 2006 15:52 GMT
>>Zend core. There's something I've not come across. I really wonder if it
>>will help me though, to store that image in a DB2 database.
[quoted text clipped - 40 lines]
> Yes, BLOB support is there (besides that a lot of other bugs don't exist
> there).

Hey, thanks alot for those. That really helps! I've been playing with
the driver too, mabey I can get it to work.. I've checked out the Zend
core for IBM as well, looks nice, but in order for me to use I need to
change alot of things etc....I'll try it on my next project.
Larry - 21 Feb 2006 19:32 GMT
> Ok, I think I just may be a moron, but where the heck are the Image
> extenders found? I've look all around, tried all the DB2 cd's I have,
> are they installed by default somewhere? Which install fileset (AIX) are
> they part of?
> The CD's only show spatial and xml extenders?
If I'm not mistaken, you have to purchase one of the Developer's
Editions to get the Image Extender (if it still even exists).

Larry Edelstein
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.