Finally, oracle, there is a solution for you to insert a value of the clob type-php Tutorial

Source: Internet
Author: User
At the end of oracle, when you insert a clob type value to connect to Oracle in php, an error will be reported when you insert & gt; 4000 characters to the clob type field in the table: the string is too long. How can we solve this problem? Can you not use the storage methods discussed? The error message "bind" is displayed. who can bind the demo code? Thank you. ------ solution ------------------ & lt ;? Phppu oracle last Oh, then you insert the clob type value appears
When using php to connect to Oracle, if you insert data greater than 4000 characters into a clob field in the table, an error is returned: the string is too long.
How can we solve this problem?
Can you not use the storage methods discussed?
The error message "bind" is displayed. who can bind the demo code?
Thank you.

------ Solution --------------------

Putenv ("ORACLE_SID = sid1 ");
Putenv ("ORACLE_HOME =/u01/app/oracle/product/8.0.5 ");

$ Handle = ora_plogon ("[email protected]", "TIGER") or die;
$ Cursor = ora_open ($ handle );
Ora_commitoff ($ handle );

$ Query = "SELECT * from emp ";
Ora_parse ($ cursor, $ query) or die;
Ora_exec ($ cursor );

Echo"
\n";
echo "$query\n\n";
$numcols = 0;
while(ora_fetch($cursor)) {
$numcols = ora_numcols($cursor);
for ($column=0; $column < $numcols; $column++) {
$data = trim(ora_getcolumn($cursor, $column));
if($data == "") $data = "NULL";
echo "$data\t";
}
echo "\n";
}
$numrows = ora_numrows($cursor);
echo "\nROWS RETURNED: $numrows\n";
echo "
\ N ";

Ora_close ($ cursor );

?>
(Points)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.