Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: put clob into oracle db from php

Re: put clob into oracle db from php

From: Andy Hassall <andy_at_andyh.org>
Date: Tue, 19 Nov 2002 11:26:08 +0000
Message-ID: <no7ktus21b1vi5mkbs6f9cmcupnqntf4is@4ax.com>


On 19 Nov 2002 03:04:03 -0800, kummer_at_w3concepts.ch (alex) wrote:

>i have following problem: i try to insert character data into a clob
>column in a oracle database. the character data contains line feeds,
>carriage returns and other characters which normally have a function
>in query strings.
>
>i tried to insert the data using a normal query string. however, i
>always got the message, that the data contains illegal characters. is
>there a way i can put my 'illegal characters' into the db anyway?

 Sounds like you're embedding the value into the query itself. Do NOT do this, ever; use bind variables.

>i forgot to mention that i use php4 and odbc to access the db. and so
>far i did not find a possiblity to convert the string to unicode.

 There is an example on inserting CLOBs on the front page of the OCI8 section of the PHP manual.

http://www.php.net/manual/en/ref.oci8.php

 Scroll down to Example 1.

 And one for BLOBs in the OCINewDescriptor section:

http://www.php.net/manual/en/function.ocinewdescriptor.php

-- 
Andy Hassall (andy@andyh.org) icq(5747695) http://www.andyh.org
http://www.andyhsoftware.co.uk/space | disk usage analysis tool
Received on Tue Nov 19 2002 - 05:26:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US