It's not a secret anymore!*
The moose likes JDBC and the fly likes com.sybase.jdbc2.jdbc.SybSQLException: Too many parameters -- symbol table overflow. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "com.sybase.jdbc2.jdbc.SybSQLException: Too many parameters -- symbol table overflow." Watch "com.sybase.jdbc2.jdbc.SybSQLException: Too many parameters -- symbol table overflow." New topic
Author

com.sybase.jdbc2.jdbc.SybSQLException: Too many parameters -- symbol table overflow.

Hari Ganesan
Greenhorn

Joined: Dec 13, 2011
Posts: 1
Hii all,

I am using jconn2.jar(5.5) jdbc driver for Sybase to connect
to a sybase database from a standalone java application.
My jave application will read thousands of
records from a text file and insert in to the table in the
sybase database.
I have a select query with IN clause.This IN clause will have more than 10,000 values. while executing this query, the
application is returning the below error:

Caused by: com.sybase.jdbc2.jdbc.SybSQLException: Too many
parameters -- symbol table overflow.

at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:3281)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:2548)
at
com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at
com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:220)
at
com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:203)
at
com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1614)
at
com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:1599)
at
com.sybase.jdbc2.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:96)

at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)

at
org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648)

at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
... 10 more

The same query is working well for values in IN clause with
up to 10,000 values.

I tried with jconnect6 and jconnect7. but same result.

Anyone is having any idea, why it's
returning the error like above for the values having more
than 10,000?

Thanks in advance
Janarthanan Rajendran
Greenhorn

Joined: Nov 07, 2011
Posts: 7

The error is clear , the number of parameters passed and the number of columns in table are not matching. Please compare the parameters list with the table column list.

Regards,
Jana
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

A query with 10,000 values in an IN clause sounds dubious to me. That looks like you get the results of one query and put them in an IN clause of another query. Unless you have a handicapped SQL server you should then use a nested query instead.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Horst Stieg
Greenhorn

Joined: Oct 14, 2011
Posts: 13

I remember from my time working with Sybase (direct queries, not with Java), that you can use not more than X values with IN. I don't remember what X was, though, but I think, it was less than 10.000. We had some strange effects in our queries and found this out by experimenting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: com.sybase.jdbc2.jdbc.SybSQLException: Too many parameters -- symbol table overflow.