Java J2ME JSP J2EE Servlet Android

ORA-01704: String literal too long

The Mail cause of this error is stating by the message itself 'String literal too long'. If you try to INSERT more than 4000 characters to a varchar2 field this error will occur. Another case where this may occur is if you try to update a CLOB field. CLOB field doesn't support update.

In Java if you try to execute PreparedStatement.executeUpdate() to INSERT or UPDATE CLOB field of ORACLE with more than 4000 characters, you'll get this error.

To avoid this use PreparedStatement.execute() methode to to INSERT CLOB field.

This may occur in other language also. And you can use same technique to avoid errors.

Happy programming.

Comment my blog/ email me for any problems related to this.