Re: Updating a CLOB-- OCI_INVALID_HANDLE
| From: | Thies C. Arntzen | Date: | Sat, 20 Jul 2002 15:48:00 +0000 |
| Subject: | Re: Updating a CLOB-- OCI_INVALID_HANDLE | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20669@lists.php.net to get a copy of this message | ||
On Mon, Jul 15, 2002 at 06:48:36PM -0400, Anthony Carlos wrote:
> Hello,
>
> Has anyone come across difficulty updating a CLOB in Oracle? I have been
> able to follow the documentation to insert a new clob by first inserting an
> EMPTY_CLOB() into the row, and then calling the save method of the
> OCINewDescriptor/CLOB locator:
>
> $conn = OCILogon("username", "password", "connect_string");
> $clob_loc = OCINewDescriptor($conn, OCI_D_LOB);
> $sql = "INSERT INTO emp (empno, name, life_story) VALUES (emp_seq.NEXTVAL,
> :name, EMPTY(CLOB)) RETURNING life_story INTO :clob_loc";
> $stmt = OCIParse($conn, $sql);
> OCIBindByName($stmt, ":name", &$name, -1);
> OCIBindByName($stmt, ":life_story", &$clob_loc, -1, OCI_B_CLOB);
> OCIExecute($stmt, OCI_DEFAULT);
> $clob_loc->save($new_life_story);
>
> However, attempts to "SELECT life_story INTO :clob_loc FROM emp WHERE empno
> = 123 FOR UPDATE" have failed. Similarly, "UPDATE emp SET name = 'NEW_NAME'
> WHERE empno = 123 RETURNING life_story INTO :clob_loc" have also failed. The
> error message is the same:
there's no need to select "life_story INTO :clob_loc".
see http://conf.php.net/pres/slides/oci/paper.txt
wor a
working example (plus other stuff)
re,
tc