Clob field inserted in Php+oracle is greater than 4000 bytes quoted string literal too long

Source: Internet
Author: User
Rt,google says that SQL statements are too long to be used in the form of bound variables. Project with Yii,so, I use Yii bindparam, but solved the newspaper character is too long, but the new error: can only bind to insert long column Long value.
Tangled in,, for help.

This issue has been closed due to:

Reply content:

Rt,google says that SQL statements are too long to be used in the form of bound variables. Project with Yii,so, I use Yii bindparam, but solved the newspaper character is too long, but the new error: can only bind to insert long column Long value.
Tangled in,, for help.

Digging graves. It took so long to find a solution by accident. The original Oracle official documentation has the method. Sweat...
Use the php_oci8 extension.
When inserting:

$sql = "INSERT into Mylobs          (id,mylob)        VALUES          (mylobs_id_seq. Nextval,empty_clob ())       returning          mylob into:mylob_loc "; $stmt = Oci_parse ($conn, $sql); $myLOB = Oci_new_ Descriptor ($conn, Oci_d_lob); Oci_bind_by_name ($stmt, ": Mylob_loc", $myLOB,-1, Oci_b_clob); Oci_execute ($stmt, Oci_ DEFAULT) or Die ("Unable to execute query\n"), $myLOB->save (' Mylob_loc '); Oci_commit ($conn); Oci_free_statement ($ stmt); $myLOB->free (); Oci_close ($conn);

Http://www.oracle.com/technetwork/art ...

  • 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.