PreparedStatement + Select for update + Oracle 12c + ORA-01461 in primary key column PreparedStatement + Select for update + Oracle 12c + ORA-01461 in primary key column oracle oracle

PreparedStatement + Select for update + Oracle 12c + ORA-01461 in primary key column


Opened an SR to oracle since this is a bug of 12.1.0.2.0 jdbc driver and would need a patch to resolve it.


This error occurs trying to use a varchar variable longer than 4000 bytes in an SQL statement (4000 bytes is the limit).

You should check what the uuid variable contains paying attention to possible encoding.

Anyway store the UUID like VARCHAR datatype is not a good idea.

The workaround to make it work could be change the TEST_ID datatype from VARCHAR2 to CLOB (removing the PK like you said in the comment below) but this is not the solution.