4096 character limit on single SELECT statement?
699319May 1 2009 — edited Oct 1 2013Hi,
Is there a limit on the length of SQL statements that Oracle can handle?
I am using java Statement class to execute an sql query.
I always get correct result set as long as my query stays under 4096 characters.
But if my sql query is longer than 4096, then the ResultSet is empty.
Note that there are no exceptions being thrown by executeQuery when this happens, just an empty set gets returned.
String sql = "SELECT FROM ... very long IN clause";
java.sql.Statement stmt = DBUtilities.getConnection(txn).createStatement();
ResultSet set = stmt.executeQuery(sql);