Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle, PERL & blobs

Re: Oracle, PERL & blobs

From: John D Groenveld <groenvel_at_cse.psu.edu>
Date: 19 Jun 1998 00:16:33 -0400
Message-ID: <6mcon1$22r$1@tholian.cse.psu.edu>


Fetch with blob_read.
John
groenveld_at_acm.org

#!/usr/bin/perl -w

use strict;
use DBI;
use GD;

my $img = new GD::Image(100,100);
my $long_raw = $img->gif;

my $dbh = DBI->connect("dbi:Oracle:", "scott", "tiger",

	{AutoCommit=>0, LongTruncOk=>1,PrintError=>undef})
	or die "$DBI::err: $DBI::errstr\n";
my $sth = $dbh->prepare("INSERT INTO foobar VALUES (?, ?)")
	or die "$DBI::err: $DBI::errstr\n";

$sth->bind_param(1, "1");
$sth->bind_param(2, $long_raw, {"ora_type", 24});
$sth->execute()

        or die "$DBI::err: $DBI::errstr\n";
$sth->finish

        or die "$DBI::err: $DBI::errstr\n";
$dbh->commit

        or die "$DBI::err: $DBI::errstr\n";
$dbh->disconnect

        or die "$DBI::err: $DBI::errstr\n"; Received on Thu Jun 18 1998 - 23:16:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US