Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-03113 error Please HELP!!
On Sun, 31 Aug 2003 07:17:02 -0400, dominant <member32241_at_dbforums.com> wrote:
>Here is the erro message
>
>DBD::Oracle::st execute failed: ORA-03113: end-of-file on
>communication channel
See Daniel Morgan's numbered points about this one, and check the alert log.
>What is wrong with blobs?
Well - you're not even using blobs in your example, you're attempting to use the deprecated LONG RAW datatype. Where did you get this code from?
See the DBD::Oracle docs on handling LOBs.
http://theoryx5.uwinnipeg.ca/CPAN/data/DBD-Oracle/Oracle.html#Handling_LOBs
>Here is my code
>
>#!/usr/local/bin/perl
use strict;
use warnings;
... as these will let Perl give you more help.
>use DBI;
>
>$LONG_RAW_TYPE=24; # Oracle type id for blobs
Don't harcode constants. This is the wrong one, anyway. Import them from the DBD::Oracle package.
use DBD::Oracle qw(:ora_types);
You'll then later use ORA_BLOB as the datatype when binding.
> $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);
Replace these two lines with:
$stmt->bind_param(1, $buf, { ora_type => ORA_BLOB });
> $stmt->execute() || die "\nExecute error: $DBI::err ....
> $DBI::errstr\n";
>
> print STDERR "Complete.\n";
-- Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)Received on Sun Aug 31 2003 - 10:43:19 CDT