PHP processes Oracle CLOB instances and oracleclob instances. PHP processes Oracle CLOB instances. oracleclob instances this article describes how PHP processes Oracle CLOB. Share it with you for your reference. The specific method is as follows: 1. when writing data, use PHP to process Oracle CLOB instances and oracleclob instances.
This example briefly describes how PHP processes Oracle CLOB. Share it with you for your reference. The specific method is as follows:
1. write data
When PDO preprocessing is used, if bindParam () is used without specifying the data type of the field or execute (), PDO defaults to the string type and limits a default length.
Therefore, bindParam () or bindValue () must be used to store clob fields and specify the string length. for example:
The code is as follows:
$ Pdo-> bindParam (': clobdata', $ clobData, PDO: PARAM_STR, strlen ($ clobData ));
2. read data
The CLOB field value retrieved by PDO is a resource identifier when this field is not empty. if it is null, it is a null string. The data retrieval method is as follows:
The code is as follows:
$ Arr = $ pdo-> fetch ();
Is_resource ($ arr ['clob']) & $ arr ['clob'] = stream_get_contents ($ arr ['clob']);
I hope this article will help you with PHP programming.
Why does php always prompt errors when operating oracle's clob type?
Dude, I also encountered this problem. I solved it with the same solution.
How does php read the clob field?
Write Data
When PDO preprocessing is used, if bindParam () is used without specifying the data type of the field or execute (), PDO defaults to the string type and limits a default length.
Therefore, bindParam () or bindValue () must be used to store clob fields and specify the string length, for example, $ pdo-> bindParam (': clobdata', $ clobData, PDO:: PARAM_STR, strlen ($ clobData ));
Read Data
The CLOB field value retrieved by PDO is a resource identifier when this field is not empty. if it is null, it is a null string. The data retrieval method is as follows:
$ Arr = $ pdo-> fetch ();
Is_resource ($ arr ['clob']) & $ arr ['clob'] = stream_get_contents ($ arr ['clob']);
Hope to help you
The example in this article describes how PHP processes Oracle CLOB. Share it with you for your reference. The specific method is as follows: 1. writing data is in use...