note 36035 modified in function.ocinewdescriptor by sixd
| From: | sixd@php.net | Date: | Thu, 08 Oct 2009 19:27:09 +0000 |
| Subject: | note 36035 modified in function.ocinewdescriptor by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161547@lists.php.net to get a copy of this message | ||
Just a note. When INSERTing a CLOB, if a VALUES clause is used, Oracle notes: You cannot initialize
an internal LOB attribute in an object with a value other than empty or null. That is, you cannot
use a literal.
That's why all the examples here INSERT an EMPTY_CLOB(), and use RETURNING to grab the pointer.
However, a CLOB can also be INSERTed via a SELECT statement, and that won't require any
descriptors.
Example:
$Clob = Str_Replace("'", "''", $Clob);
OCIParse($DB, "INSERT INTO My_Table (My_Clob) SELECT '$Clob' FROM Dual");
This, of course, allows the use of a WHERE clause as well.
--was--
Just a note. When INSERTing a CLOB, if a VALUES clause is used, Oracle notes: You cannot initialize
an internal LOB attribute in an object with a value other than empty or null. That is, you cannot
use a literal.
That's why all the examples here INSERT an EMPTY_CLOB(), and use RETURNING to grab the pointer.
However, a CLOB can also be INSERTed via a SELECT statement, and that won't require any
descriptors.
Example:
$Clob = Str_Replace("'", "''", $Clob);
OCIParse($DB, "INSERT INTO My_Table (My_Clob) SELECT '$Clob' FROM Dual");
This, of course, allows the use of a WHERE clause as well.
http://php.net/manual/en/function.ocinewdescriptor.php