Re: Oracle NClobs
| From: | Christopher Jones | Date: | Fri, 05 Aug 2011 16:36:35 +0000 |
| Subject: | Re: Oracle NClobs | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47950@lists.php.net to get a copy of this message | ||
On 08/05/2011 08:55 AM, N.A.Morgan@brighton.ac.uk wrote:
Guys, Can anyone help please? I am using Oracle 10g (10.2.0.3) with PHP 5.2.5. The following piece of code works with a CLOB, but not with an NCLOB. Can anyone shed any light please?There is no support for NCLOB in PHP OCI8. Chris
$SQL = "-- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/UPDATE $d_sid.srs_spd SET spd_fuld = EMPTY_CLOB() WHERE spd_stuc = :stuc AND spd_seqn = :seqn AND spd_pdtc = 'VOAM' returning spd_fuld into :THE_CLOB"; $Clob = oci_new_descriptor($conn, OCI_D_LOB); $stmt = oci_parse($conn,$SQL); if (!is_resource($stmt)) throw new Exception("Internal Error: E_SPD_POPULATE (Parse 2)"); oci_bind_by_name($stmt,":stuc",$V->Get("Student")); oci_bind_by_name($stmt,":seqn",$Out); oci_bind_by_name($stmt,":THE_CLOB", $Clob, -1, OCI_B_CLOB); $exec = oci_execute($stmt, OCI_DEFAULT); if (!$exec) throw new Exception("Internal Error: E_SPD_POPULATE (Exec 2)"); $Clob->save($this->EMail); if (!oci_commit($conn)) {oci_rollback($conn); throw new Exception("Internal Error: E_SPD_POPULATE - Can't Save Character Large Object");} Regards, Neil Morgan PGCert MSc IT Services University of Brighton Watts 137 Lewes Road Brighton BN2 4GJ 01273 643930 ___________________________________________________________ This email has been scanned by MessageLabs' Email Security System on behalf of the University of Brighton. For more information see http://www.brighton.ac.uk/is/spam/ ___________________________________________________________