1 Reply Latest reply: Apr 14, 2010 2:07 PM by 288739 RSS

    Creating/editing entries w/NCLOB result in 00904: 'EMPTY_CLOB" error

    766344
      Hey all-
      I'm new to the whole Ruby+Oracle development, and have a question about NCLOBs. This is what happens when I try to edit or create entries in a table through my auto-generated web interface:

      when editing:

      OCIError: ORA-00904: "EMPTY_NCLOB": invalid identifier: UPDATE peer_groups SET syn = empty_nclob() WHERE id = 93

      when creating a new entry:

      OCIError: ORA-00904: "EMPTY_NCLOB": invalid identifier: INSERT INTO peer_groups (name, type, id, syn, parent) VALUES('dd', 'REGULAR', 910, empty_nclob(), 93)

      Since I just started this project, I replicated the project in two environments - one using Ruby 1.8.6/Ruby-OCI8 1.0.7/Oracle Adapter(latest) and another using Ruby 1.9.1/Ruby-OCI8 2.0.4/Oracle_Enhanced Adapter (latest). (Ed- OS is WinXP Pro SP3.) The problem occurs in both. Primary key is ID, even though this is a legacy environment...

      So I poked around for a while, but only found a few fixes for earlier versions of Rails that are irrelevant to me. I also peaked a the Oracle Adapter and Oracle_Enhanced Adapter to try to account for this; it told me that LOBs are support through an after_save callback, but I really don't quite know how useful knowing this is.

      Editing of an entry's other attributes works if attribute 'syn', which is our NCLOB, is left untouched.

      -e

      Edited by: user9257372 on Apr 13, 2010 5:29 AM