Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Unanswered: Inserting CLOB produces ORA-00984 (PHP)

    Hello,

    Here's my form and my table

    web form
    -----------
    stu_num
    last
    first
    writing

    table
    -----------------
    stu_number (int)
    lastName (varchar)
    firstName (varchar)
    essay (CLOB)

    When I fill out the form and hit submit, I get the following error on the OCIExecute line:
    ORA-00984: column not allowed here

    Here's the code:
    $lob = OCINewDescriptor($conn, OCI_D_LOB);

    $stmt = OCIParse($conn, 'INSERT INTO clob_table (firstName, lastName, stu_number, essay) VALUES ('.$first.','.$last.','.$stu_num.', EMPTY_CLOB()) RETURNING essay INTO :essay');

    OCIBindByName($stmt, ':essay', $lob, -1, OCI_B_CLOB);

    OCIExecute($stmt, OCI_DEFAULT);

    My gut instinct tells me the error has something to do with one of two things:
    1) the parse statement, especially the RETURNING essay INTO :essay portion
    2) the bind statement, especially the :essay portion

    I've tried substituting the field name (writing) with the variable name (essay) and vice versa in several combinations, but of course, no luck....

    Could anyone please give me a hint as to why this error is occuring?

    Thanks,
    Roger

  2. #2
    Join Date
    Oct 2003
    Posts
    2

    SOLVED

    I had to replace the 'INSERT' statement with "INSERT" for some reason it didn't like the ' in the statement. Once I put in " instead, it worked like a charm....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •