Jo wrote:
Hi.
I'm getting the following error when creating a table with 250 columns
. I have tried creating it in a 32K tablespace , still the same issue.
Is this a limitation in DB2? I am using DB2 v8.2 FP 9a.
SQL0670N The row length of the table exceeded a limit of "32677"
bytes.
(Table space "".) SQLSTATE=54010
Any advice will be appreciated
Thanks a lot.
Jo,
It sounds like your issue is not the number of columns but the total length
of the columns in the columns. There is a limit of 32k (32677) on
"standard" columns (not counting LONG VARCHAR and LOB type columns).
I'd suggest that it is very unusual indeed to require that amount of data in
one table : it suggests that either you are using the wrong data types or
you have a design issue.
As a start, look at your VARCHAR columns and turn the longest ones into LONG
VARCHAR or CLOB. You maybe want, for performance reasons, to separate
your LONG data into a separate tablespace (create DMS tablespaces,
including a LARGE one and use "LONG IN tsname" in the CREATE TABLE
definition).
But above all, review your design to ensure that all the attributes you have
are directly related to the key : that you don't have repeating groups, for
example (e.g. ADDRESS1, ADDRESS2, ADDRESS3, ...).
HTH
Phil