Things are getting better and better :) Here is my new code
---------------------------------------------------------------------------- ---------------- #!/usr/local/bin/perl -w use DBI; use Tk; use strict; my $max_len = 2000000; my $mw=new MainWindow; my $dbh = DBI->connect( ) or die "Connecting : $DBI::errstr\n "; my $filename=$mw->getOpenFile(-filetypes=>[['files','*.gif']]); my $doc; if($filename) { open(BLOB, $filename); binmode(BLOB); my $doc_len = read (BLOB, $doc, $max_len); close(BLOB); print "Length $doc_len"; my $stmt = $dbh->prepare("INSERT INTO hr.documents VALUES (hr.autoinc.nextval ,'$filename',?)") || die "\nPrepare error: $DBI::err .... $DBI::errstr\n"; $stmt->bind_param(1, $doc, {ora_type => 24} ); $stmt->execute() || die "\nExecute error: $DBI::err .... "; print STDERR "Complete.\n";} MainLoop; ---------------------------------------------------------------------------- --- And that is the error message. ------------------------------------------------- Length 4729DBD::Oracle::st execute failed: ORA-03113: end-of-file on communicati on channel (DBD: oexec error) at C:/progs/dika/blob/insert_blob_test.pl line 40. Execute error: 3113 .... at C:/progs/dika/blob/insert_blob_test.pl line 40. Press Enter to continue ------------------------------------------------------------------------ What is wrong now??? Please HELP!! ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "dbi-users" <[EMAIL PROTECTED]> Sent: Saturday, August 30, 2003 1:07 PM Subject: Still having problems with the BLOBs > Here is my code to pick a file from my disk and insert it into the Oracle > > ------------------------------------------- > #!/usr/local/bin/perl -w > > use DBI; > use Tk; > > $mw=new MainWindow; > > $dbh = DBI->connect( "DBI:Oracle:host=$host;sid=$sid", $username, $password) > or die "Connecting : $DBI::errstrn "; > > > > $filename=$mw->getOpenFile(-filetypes=>[['All files','*.*']]); > > if($filename) { > open(BLOB, $filename); > > my $blob=<BLOB>; > close(BLOB); > > $stmt = $dbh->prepare("INSERT INTO hr.documents VALUES > ('10','$filename',?)") || die "nPrepare error: $DBI::err .... > $DBI::errstrn"; > > $dbh->{LongReadLen} = 4 * 1024 * 1024; > > $stmt->bind_param(1, $blob, {ora_type => 113} ); > > $stmt->execute() || die "nExecute error: $DBI::err .... "; > > print STDERR "Complete.n";} > MainLoop; > ------------------------------------------------------ > > and the error i always recieve is > > ------------------------------------------------------ > DBD::Oracle::st execute failed: ORA-01465: invalid hex number (DBD: oexec error > at C:/progs/dika/blob/insert_blob_test.pl line 43. > > Execute error: 1465 .... at C:/progs/dika/blob/insert_blob_test.pl line 43. > Press Enter to continue > ------------------------------------------------------- > > Line 43 is $stmt->execute() || die "nExecute error: $DBI::err .... "; > > > > What am i doing wrong? >