Re: Pear DB - Oracle - Problem with strings bigger than 4K
| From: | paul | Date: | Sat, 22 Feb 2003 10:38:00 +0000 |
| Subject: | Re: Pear DB - Oracle - Problem with strings bigger than 4K | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3897@lists.php.net to get a copy of this message | ||
Unfortunately I have not used the Pear Db class properly to answer how to resolve this in pear, however I do not how to resolve this directly using the PHP oracle functions.
The problem as you have rightly identified is the length of the value field, This is a limitation set by Oracle, to resolve this you need to use the oracle bind primitive http://www.php.net/manual/en/function.ora-bind.php.
This basically replaces the value <Text Bigger Than 4K> with an SQL parameter name. which Oracle references when executing the insert.
Hope this helps
Paul
On Thursday, February 20, 2003, at 05:49 PM, Alf Magne Kalleland wrote:
While using pear, I get this error-message: ORA-01704: string literal too long while trying to insert a string into the database(Oracle 9) Here's a code-example:$sql = "insert into myTable(ID,myName,textField)values('1000','AlfMagne','<Text bigger than 4K>')";$result = $db->query($sql);// Always check that $result is not an errorif (DB::isError($result)) { die ($result->getMessage()); }where <Text bigger than 4K> is a long string. Please help! Regards Alf Magne Kalleland -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php