What's the maximum number of columns in a table?
Posted in 1999
as title.
Jing Liu wrote: > as title. Well, the row size is limited to 32767 bytes. The minimum size of column is CHAR(1). So, you could in principle have 32767 different columns in the table. With older versions of Informix, you'd run into problems with the size of the CREATE TABLE statement reaching the upper limit for the size of a statement (variously 32 kB and 64 kB, I think). I'm not sure whether there is still an upper limit on the size of a statement (256 kB is lurking in the back of my mind) or the size is now unlimited, or limited to 2 GB - 1. In practice, such a table is desparately boring and would not be any real use. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Or, you could chooses to do a little testing yourself. Create a script, or program that emits a create table SQL statement. Then increase the number of columns you create until it craps out > -----Original Message----- > From: Jonathan Leffler [SMTP:jleffler@earthlink.net] > Posted At: Thursday, August 12, 1999 11:31 PM > Posted To: informix > Conversation: What's the maximum number of columns in a table? > Subject: Re: What's the maximum number of columns in a table? > > Jing Liu wrote: > > as title. > > Well, the row size is limited to 32767 bytes. The minimum size of > column is CHAR(1). So, you could in principle have 32767 different > columns in the table. With older versions of Informix, you'd run into > problems with the size of the CREATE TABLE statement reaching the > upper limit for the size of a statement (variously 32 kB and 64 kB, I > think). I'm not sure whether there is still an upper limit on the > size of a statement (256 kB is lurking in the back of my mind) or > the size is now unlimited, or limited to 2 GB - 1. > > In practice, such a table is desparately boring and would not be any > real use. > > -- > Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) > Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN > #include <disclaimer.h>