Going crazy here, I have a table described like so:
SQL> desc replies
Name Null? Type
----------------------------------------- -------- ----------------------------
REPLY_ID NOT NULL NUMBER(15)
REPLY VARCHAR2(4000)
REPLY_AUTHOR VARCHAR2(10)
REPLY_DATE DATE
THREAD_ID NOT NULL NUMBER(15)
TOOL_ID NOT NULL NUMBER(15)
ICON_ID NUMBER(15)
CATEGORY_ID NOT NULL NUMBER(15)
I wasn't using bind just a prepare and execute but when people tried
to insert a new record and the REPLY field was close to the limit I would
get string literal too long. So I switched to bind_param using the following code.
($REPLY = $myform{reply}) =~ s/'/''/g;
#my $STATEMENT2 = "update REPLIES set REPLY='$REPLY',ICON_ID='$myform{iconid}' where
REPLY_ID =
$myform{replyid}";
$stmt2 = $dbh->prepare("update REPLIES set REPLY = ?,ICON_ID = ? where REPLY_ID = ?");
$stmt2->bind_param(1,$REPLY,{TYPE => SQL_VARCHAR});
$stmt2->bind_param(2,$myform{iconid},{TYPE => SQL_NUMBER});
$stmt2->bind_param(3,$myform{replyid},{TYPE => SQL_NUMBER});
$stmt2->execute() or die $DBI::errstr;
My problem is one time it works and the next time I get
[Tue Jan 29 13:27:08 2002] adminhelp.cgi: DBD::Oracle::st execute failed: ORA-01461:
can bind a
LONG value only for insert into a LONG column (DBD ERROR: OCIStmtExecute) at
/oracle/9.0.1/Apache/Apache/cgi-bin/PostToDB.pl line 172.
I thought it had something to do with when $REPLY contained single quotes
but now I'm stumped, one time it wil work and the next it won't and I don't
even touch the single quotes.
Can anyone confirm when you have '' oracle
inserts one single quote or does it actually insert both. Because as you
can see I manipulate $REPLY converting all single quotes to 2 single quotes.
Any Help Much Appreciated!
Thanks Morry
e-mail address: [EMAIL PROTECTED]
phone: X84792/650 786-4792 fax 650 562-2143