views:

63

answers:

1

We have two installations of DB2.

When defining a foreign key with a long name, it works fine on one instance, but not on the other (we get a SQL0107N Name too long - max length is 18).

What is causing this different behaviour? Is there a parameter we can change or is it version dependant?

+3  A: 

this seems to be version dependent. according to http://ptgmedia.pearsoncmg.com/images/0672326132/downloads/appd.pdf and http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0001029.htm , the limits for referential constraint names for the 7, 8, and 9 version of db2 are as follows:

v7  8 bytes 
v8  128 bytes
v9  18 bytes

these limits cannot be changed. so Adhering to the most restrictive case can help you to design application programs that are easily portable.

ax
Thanks for the info. I thought we were both on v9, but it seems it's better to be cautious.
IronGoofy