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: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Sun, 31 Aug 2003 08:07:28 -0700
Message-ID: <3F520F30.17052A7E@exxesolutions.com>


dominant wrote:

> 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

Your concept of providing more information is in need of a tune up.

  1. What version of Oracle?
  2. What patch level?
  3. What operating system?
  4. If Solaris, HP/UX, Linux, have you verified kernel parameters were set as Oracle recommends (demands)?

To insert a BLOB using PL/SQL requires inserting an EMPTY_BLOB(), getting the length of the BLOB to be inserted, and updating the record with the BLOB value.

While I don't write DBD and must confess a great deal of ignorance it is readily apparent that the aforementioned steps did not take place. Whether they are necessary is that part I can't say for sure.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
http://www.outreach.washington.edu/extinfo/certprog/aoa/aoa_main.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Aug 31 2003 - 10:07:28 CDT

Original text of this message

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