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.
Edited by: user9257372 on Apr 13, 2010 5:29 AM
Yes, that seems is issue in oracle_enhanced adapter (I should initialize it with EMPTY_CLOB() function call.)
I will fix it in next version of adapter.
BTW it would be better to use http://groups.google.com/group/oracle-enhanced discussion group if you have any issues with oracle_enhanced adapter.