Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-03113 error Please HELP!!
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.
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