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

Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-03113 error Please HELP!!

Re: ORA-03113 error Please HELP!!

From: dominant <member32241_at_dbforums.com>
Date: Sun, 31 Aug 2003 07:17:02 -0400
Message-ID: <3307817.1062328622@dbforums.com>

Here is the erro message


DBD::Oracle::st execute failed: ORA-03113: end-of-file on communication channel

(DBD: oexec error) at C:/progs/dika/insert_blob_test.pl line 35.

Execute error: 3113 .... ORA-03113: end-of-file on communication channel (DBD: o

exec error)


instead, if i make as simple INSERT or SELECT everything is ok.

What is wrong with blobs?

Here is my code


#!/usr/local/bin/perl

use DBI;

$doDebug = 0;

$| = 1; # set stdout to flush

$LONG_RAW_TYPE=24; # Oracle type id for blobs

$dbh = DBI->connect()

                or die "Connecting : $DBI::errstr\n ";





        open(BLOB, "file.doc");


$bytes = 0;
binmode(BLOB);
$bytes = read(BLOB, $buf, 500000);
print STDERR "Read $bytes bytes...\n"; close(BLOB);
$stmt = $dbh->prepare("INSERT INTO hr.documents (documentid ,
document_name, document) VALUES (hr.autoinc.nextval,'john.doc',?)") || die "\nPrepare error:
$DBI::err .... $DBI::errstr\n";
# Bind variable. Note that long raw (blob) values must have # their attrib explicitly specified
$attrib{'ora_type'} = $LONG_RAW_TYPE;

$stmt->bind_param(1, $buf, \%attrib);

$stmt->execute() || die "\nExecute error: $DBI::err ....
$DBI::errstr\n";
print STDERR "Complete.\n"; ---------------------------------------------------------------------
--
Posted via http://dbforums.com
Received on Sun Aug 31 2003 - 06:17:02 CDT

Original text of this message

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