0

The query:

MERGE INTO app_role_data x USING (select ? name, ? xml FROM dual) d ON (x.app_name = d.name) WHEN MATCHED THEN UPDATE SET x.xml_blob = d.xml WHEN NOT MATCHED THEN INSERT(app_name, xml_blob) VALUES(d.name, d.xml)

The table:

create table app_role_data(app_name varchar2(64), xml_blob clob);

The result: When a row exists, we get ORA-01461.

The desired goal: This is a "create or replace" operation on a row in this table, effectively. If 'name' exists in the table, then the xml column should be updated, else a new row inserted.

nsayer
  • 16,925
  • 3
  • 33
  • 51
  • Huh. Turns out this happens when the row *doesn't* exist as well. It used to work. I don't know why it suddenly no longer does. Perhaps it's a length issue - the xml data has gotten magically longer than some limit? – nsayer Aug 13 '12 at 19:10

1 Answers1

0

I think this turns out to be solved by using the Spring JDBC LOB setting functionality documented at 11.7.2 of the Spring Framework documentation.

However, that isn't working either... but will be the subject of another question.

nsayer
  • 16,925
  • 3
  • 33
  • 51
  • Hello. Could you please let me know how did you fix the issue. I have very similar one described here: http://stackoverflow.com/questions/43349999/jdbctemplate-insert-or-update-oracle-blob-using-sql-merge. – kpater87 Apr 11 '17 at 19:09