By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

Index/Key length > 1100 chars

P: n/a
DB2 LUW 8.2
I need to have a combination of varchar columns, whose length is >1100,
as primary key, foreign key and unique index column.
When I try this, I get the error: SQL0613N The primary key or a unique
key identified by "PK_TEST" is too long or has too many columns.
SQLSTATE=54008
Any pointers on how to overcome this?
Thanks

Aug 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ns******@gmail.com wrote:
DB2 LUW 8.2
I need to have a combination of varchar columns, whose length is >1100,
as primary key, foreign key and unique index column.
When I try this, I get the error: SQL0613N The primary key or a unique
key identified by "PK_TEST" is too long or has too many columns.
SQLSTATE=54008
Any pointers on how to overcome this?
Thanks
According to the SQL Reference:
http://publib.boulder.ibm.com/infoce...n/r0001029.htm

Longest index key including all overhead (in bytes) 1024

So there is no way to change some sort of configuration.
Depending on what you want to do with the unique constraint, you could
reconsider your design. An artificial key is often chosen because it is
shorter and result in smaller index trees with a larger fan-out, implying
faster searches. If you can't do away with your long key at all, use an
artificial key and stick to triggers to ensure uniqueness of your longer
keys.

Or you can move to version 9, which sets the limit at 8K for a single key.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Aug 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.