Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Submitting file to Oracle via DBI
Below you'll find a subroutine from a script that I'm writing to submit
a file and its related information into a table in Oracle. The field
that I'm having problems with is the one where the file is to be
stored.
The field is defined as a LONG in the table and the file is only 164 kilobytes, so the size isn't the problem, but when I try to submit it, I get this error:
The line it's referring to is the line where the statement gets executed - I've denoted it with a comment below.
Can anyone help me with this problem? I've tried a lot of things, but nothing seems to work! I can submit smaller files, so what's the deal?
Any information would be greatly appreciated. If you reply, please copy my email as well.
Thanks,
Kirk
sub submitCtrakFileToDB
{
my $self = shift(); # First parameter when dealing with objects is
always
# an object reference. my $ctrakinfo = shift(); # CtrakInfo objectmy $filename = shift();
my $sql = qq{INSERT INTO CRIMSON VALUES ('$ctrakinfo->{stream}','$ctrakinfo->{context}','$ctrakinfo->{cpu}','$ctrakinfo->{category}','$ctrakinfo->{calltrak_name}','$ctrakinfo->{description}','$ctrakinfo->{author}', ? ,'$ctrakinfo->{calltrak_filename}')};
my $sth = $dbh->prepare($sql) || die $main::sth->errstr;
$ctrakinfo->dumpInfo();
$sth->bind_param(1, $ctrakinfo->{calltrak_file}, {TYPE => ORA_LONG})
|| die $sth->errstr;
#line 64 follows:
$rval = $sth->execute();
if ($rval > 0)
{ print("The calltrak info for '$ctrakinfo->{calltrak_filename}' was successfully submitted to the\nCrimson database.\n"); }
}
--
Kirk Herlitz
MTX Design Productivity Tools Team
(972) 685-5833 (ESN 445-5833)
kherlitz_at_nortelnetworks.com
Received on Mon Nov 15 1999 - 16:25:31 CST