I have an oracle database whiwh contain a CLOB type field to pass the 4000 character limit of VARCHAR2.

The select function here seem to do what i want :
$query="SELECT :description FROM table WHERE id = $id";
ora_parse($result,$query,0);
ora_bind($result, "desc", ":description", 32000);
ora_exec($result);

But the insert function here is wrong :
$query="INSERT INTO table (description) VALUES ( :description )";
ora_parse($result,$query,0);
ora_bind($result, "desc", ":description", 32000);
ora_exec($result);

i don't understand why ?
Can anybody tell me more on the ora_bind use ?

    First off, the Ora_() functions where designed for use with Oracle7 not Oracle8. In other words, they weren't designed to support CLOBs, so be glad that they have met your needs this far. In the future go with the OCI() functions.

    Second, the insert is failing because there are size limits in how PHP interfaces to the Oracle Client libraries, and in the Oracle Client libraries themselves. Instead take a look at the functions in the DBMS_LOB package. They will allow you to read and write chunks of CLOBs.

    -- Michael
    Darkstreak Computing & Innovations
    www.darkstreak.com

      Thanks a lot for this advice...

      I read now the oracle doc (DBMS_LO😎 and i learn a lot in LOB.

      I have another question :
      How to transfer a variable in php to a SQL request ? with the OCIBindByName function which is designed for CLOB ?

      thanks again
      PhilFazer

        You wrote:

        How to transfer a variable in php to a SQL request?
        with the OCIBindByName function which is designed for CLOB?

        The DBMS_LOB functions allow you to get/put 'chunks' of a CLOB. These chunks are just VARCHAR2s, so they can be passed into the function call via the OCIBindByName().

        -- Michael
        Darkstreak Computing & Innovations
        www.darkstreak.com

          OK thanks a lot...

          You help me more than a doc can do !!!!

          PhilFazer

            Write a Reply...