SQLite JDBC column count

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLite JDBC column count

Manoj
Am using SQLite jdbc 3.7.2 and in a scenario i have a table with 2300 column which eventually throwed too many columns exception since the maximum allowed column count is 2000.

Is there any workaround available for this? Maybe a query to increase column limit in SQLite jdbc?

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: SQLite JDBC column count

Simon Slavin-3

On 8 Jul 2014, at 6:51am, Manoj <[hidden email]> wrote:

> Am using SQLite jdbc 3.7.2 and in a scenario i have a table with 2300 column
> which eventually throwed too many columns exception since the maximum
> allowed column count is 2000.
>
> Is there any workaround available for this? Maybe a query to increase column
> limit in SQLite jdbc?

I cannot conceive of any way to hold the definitions of 2300 columns in your head at one time.  Therefore your database is badly designed.

It might be worth remembering that given the design of SQLite, if you need the value of column 1900 of a specific row, SQLite has to read 1900 values in order to find that value.

Are these columns numbered ?  If so, you have a relational database and should be using a related table.

Do the columns come in sets (e.g. 23 sensors each measuring 100 things) ?  If so, you still have a relational database and should be using a table (e.g. of sensors) a relation.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite JDBC column count

Roger Binns
In reply to this post by Manoj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/07/14 22:51, Manoj wrote:
> Is there any workaround available for this?

https://sqlite.org/limits.html#max_column

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlO8B14ACgkQmOOfHg372QRr6QCfZfbcFkz/lowVT8uBFy92FY/7
fEAAn1+GgxCIW81Ml848hgbrB+C6bUhw
=LzUJ
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite JDBC column count

Manoj
In reply to this post by Simon Slavin-3
I do understand its a bad DB design and i should be actually doing what you have mentioned. But as mentioned in SQLite site it is possible to increase column limit during compile time. So i just need to know out of curiosity how it can be done in SQLite jar (jdbc) 3.7.2?