PHP crashed when I try use bind function in PDO on Oracle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DavidPL

    PHP crashed when I try use bind function in PDO on Oracle

    Hello,
    I have some problem with bind method in PDO on Oracle with clob | long
    column type.

    I have table named TEST_TABLE where I have two columns: ID (int 10, 0)
    and TEXT (varchar 4000 or long or clob).

    When I try execute PHP code (based on example in manual):

    <?php
    $sql = 'SELECT id, text FROM test_table';
    try
    {
    $stmt = $this->m_pdoConnectio n->prepare($sql );
    $stmt->execute();

    /* Bind by column number */
    $stmt->bindColumn(1 , $id);
    $stmt->bindColumn(2 , $text);

    while ($row = $stmt->fetch(PDO::FET CH_BOUND))
    {
    $data = $id . "\t" . $text . "\t";
    print $data;
    }
    }
    catch (PDOException $e)
    {
    print $e->getMessage() ;
    }
    ?>

    When column TEXT type is varchar(4000) all works ok, but I can write
    text only to 4000 chars.

    When column type is long I have: "Warning: PDOStatement::f etch()
    [function.fetch]: column 1 data was too large for buffer and was
    truncated to fit it in ...skrypt.php.. . on line ...xxx...", and text in
    $text is cut to 1000 chars, and...

    When column type is clob PHP is crashed.

    I have PHP 4.1.2 and Oracle 10g.

    Please check this if You can.
    Thanks

    --
    Dawid Szalega

  • Andy Hassall

    #2
    Re: PHP crashed when I try use bind function in PDO on Oracle

    On 7 Jul 2006 00:48:00 -0700, "DavidPL" <dawid.szalega@ gmail.comwrote:
    >I have some problem with bind method in PDO on Oracle with clob | long
    >column type.
    >
    >I have PHP 4.1.2 and Oracle 10g.
    What version of PHP do you really have?

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • DavidPL

      #3
      Re: PHP crashed when I try use bind function in PDO on Oracle

      I have PHP 4.1.2 and Oracle 10g.
      >
      What version of PHP do you really have?
      Upss... Sorry...
      I have PHP 5.1.2 of coruse and Oracle 10.2g

      --
      Dawid Szalega

      Comment

      • Mladen Gogala

        #4
        Re: PHP crashed when I try use bind function in PDO on Oracle

        On Mon, 10 Jul 2006 00:16:42 -0700, DavidPL wrote:
        Upss... Sorry...
        I have PHP 5.1.2 of coruse and Oracle 10.2g
        5.1.4 fixed many problems with PDO_OCI, but it still doesn't have get
        metadata, which means that you cannot describe a cursor. In my opinion
        PDO_OCI will be usable with PHP 5.2.x

        --


        Comment

        Working...