PHP handles Oracle's CLOB instances, Oracleclob instances _php Tutorials

Source: Internet
Author: User

PHP handles Oracle's CLOB instances, Oracleclob instances


This paper gives a brief description of how PHP handles Oracle's CLOB. Share to everyone for your reference. Here's how:

1. Writing data

When using the PDO preprocessing method, if you use Bindparam () and so on without specifying the data type of the field or using Execute (), PDO defaults to the string type and limits a default length

Therefore, you must use Bindparam () or bindvalue (), etc. when you save the Clob type field, and specify the string length, for example:
Copy the code as follows: $pdo, Bindparam (': Clobdata ', $clobData, PDO::P Aram_str,strlen ($clobData));

2. Reading data

The Clob field value that PDO takes out is a resource identifier when the field is not empty, and an empty string for the data method as follows
Copy the code as follows: $arr = Fetch ($PDO);
Is_resource ($arr [' Clob ']) && $arr [' Clob '] =stream_get_contents ($arr [' Clob ']);

I hope this article is helpful to everyone's PHP programming.


PHP operation Oracle CLOB Type, why always prompt error

Man, I also have this problem ah, with the solution, resolved to say AH

How PHP reads the CLOB field

Write Data
When using the PDO preprocessing method, if you use Bindparam () and so on without specifying the data type of the field or using Execute (), PDO defaults to the string type and limits a default length
So you must use Bindparam () or bindvalue () and so on when you save the Clob type field, and specify the string length, for example, $pdo bindparam (': Clobdata ', $clobData, PDO::P aram_str, Strlen ($clobData));

Reading data
The Clob field value that PDO takes out is a resource identifier when the field is not empty, and an empty string for the data method as follows
$arr = Fetch () $pdo;
Is_resource ($arr [' Clob ']) && $arr [' Clob '] =stream_get_contents ($arr [' Clob ']);

I hope I can help you.

http://www.bkjia.com/PHPjc/904919.html www.bkjia.com true http://www.bkjia.com/PHPjc/904919.html techarticle PHP handles Oracle's CLOB instances, Oracleclob examples This article outlines PHP's approach to handling Oracle's CLOB. Share to everyone for your reference. The method is as follows: 1. Write data in use ...

  • Related Article

    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.