dbi_jpgs_in_oracle

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Loading jpg images into Oracle 7.3.4
From: "Vincent F. Melody" <vmelody@saintmarys.edu>
Date: Thu, 10 Aug 2000 16:09:12 -0500

I need some help I a trying to find a way to load a jpeg image from 
a file into a long raw field in an oracle database.  I found some 
information in the Perl cookbook in chapter 8.11.  What I am not quite 
sure of is how perl is storying the data. Is there a way to store an
entire file as a single variable so that I can insert it into an oracle
table?

===

Subject: RE: Loading jpg images into Oracle 7.3.4
From: "Tim Harsch" <harsch1@llnl.gov>
Date: Thu, 10 Aug 2000 14:23:47 -0700

local $/;

$scalar = <FILE>;
}

-or-
$scalar = join( '', <FILE> );

I don't know first hand but you might be better using BLOB than LONG RAW.
Not certain if they have BLOBs in 7.3.
===

Subject: RE: Loading jpg images into Oracle 7.3.4
From: "Douglas Wilson" <dougw@racesearch.com>
Date: Thu, 10 Aug 2000 15:55:38 -0700

Original Message-----
> From: dbi-users-bounce@isc.org [mailto:dbi-users-bounce@isc.org]On
> Behalf Of Tim Harsch
> Sent: Thursday, August 10, 2000 2:24 PM
> To: Vincent F. Melody; dbi-users@isc.org
> Subject: RE: Loading jpg images into Oracle 7.3.4
> 
> 
> 
> {
> local $/;
> 
> $scalar = <FILE>;
> }

or

read FILE, $scalar, -s FILE;

===

Subject: RE: Loading jpg images into Oracle 7.3.4
From: Ilya Sterin <ideas_pc@usa.com>
Date: Fri, 11 Aug 2000 08:36:55 -0400 (EDT)

You use place holders.  First read the file and assign the image code to
scalar then insert.  You also might have to unpack("H*", ) or not.  Also use
read_blob when extracting.  For complete examples see README.longs in the
DBD::Oracle package.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu