0

We are using a query with IN clause to filter resultset on the basis of a parameter value. In that parameter, we have more than 10K values. Is there any character limit in SQL query while executing it with JDBC statement.

SELECT * FROM TABLE WHERE COLUMN IN (value_List)

where value_List have more than 10k comma separated values.

Statement stmt = conn.createStatement();
String sql ="SELECT * FROM TABLE WHERE COLUMNNAME IN (value_List)";
ResultSet rs = stmt.executeQuery(sql);
sandeep tiwari
  • 117
  • 1
  • 5
  • Maybe this can help you: [SQL TOP, LIMIT or ROWNUM Clause](https://www.w3schools.com/sqL/sql_top.asp) – Antonio Veneroso Contreras May 18 '19 at 18:48
  • @AntonioVenerosoContreras the `sql` tag is about valid ANSI/ISO SQL standards.. Those limiting keywords arn't valid ANSI/ISO SQL but SQL dialects invented by database vendors. – Raymond Nijland May 18 '19 at 19:07
  • 1
    See [Why should I provide an MCVE for what seems to me to be a very simple SQL query?](https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql-query) .. *"Is there any character limit in SQL query"* Also most likely you would also have to tag a database product like MySQL, PostgreSQL or SQL Server as string handling is not really (totally) defined in the SQL standards. – Raymond Nijland May 18 '19 at 19:11

0 Answers0