Re: CLOB column insert errors.
| From: | Thies C. Arntzen | Date: | Mon, 06 Nov 2000 12:59:34 +0000 |
| Subject: | Re: CLOB column insert errors. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23873@lists.php.net to get a copy of this message | ||
On Mon, Nov 06, 2000 at 12:01:13PM +0000, simon wrote:
> Hi everyone,
>
> I use the following code to insert data to clob columns (you'll notice
> that it's v. similar to the
> OCINewDescriptor() example in the manual):-
>
> -------------------------------------------------
> $sql_text = "insert into clb (name, muchtext) values (name= 'simon',
> muchtext= empty_clob()) returning muchtext into :muchtext";
plz try:
"insert into clb (name, muchtext) values ('simon',empty_clob()) returning
muchtext into :muchtext";
tc
>
>
> $sql = OCIParse($conn_id, $sql_text );
>
> $lob = OCINewDescriptor($conn_id, OCI_D_LOB);
>
> OCIBindByName ($sql, ":muchtext", &$lob, -1, OCI_B_CLOB);
>
> OCIExecute($sql, OCI_DEFAULT); //(line 29)
>
> if ( $lob->save ("some text")) //(line 30)
> {
> OCICommit($conn_id);
> }
> else
> {
> echo "Could not write text to column<BR>\n";
> }
> ----------------------------------------------
>
> I get the following errors:-
>
> Warning: OCIStmtExecute: ORA-00917: missing comma in path/file on line
> 29
>
> Warning: OCILobWrite: OCI_INVALID_HANDLE in path/file on line 30
> Could not write text to column
>
>
> I am not sure if I have to declare a bind variable first i.e.
> VARIABLE muchtext CLOB. When I tried to do this, I got a "bad variable
> specification error".
>
> Can anyone advise what to do?
>
> Please reply before I lose all my hair!
>
> Many thanks,
>
> Simon.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>