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

Maximum length for table names, colums etc.

P: n/a
Hello,

we are planning to port an application from one database to different
others, including DB2.
While reading the GettingStarted document for DB2 Personal Edition I got
a little confused about the allowed length for object names.

Did I understand this correct:

table names -> 128 characters (if ANSI characters)
column names -> 18 char.
primary key names -> 18 char.

In a web forum I found a hint that column names may be 30 characters
long, now I don't now if this is correct.

Thanks for help,

Jens

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jens Riedel wrote:
Hello,

we are planning to port an application from one database to different
others, including DB2.
While reading the GettingStarted document for DB2 Personal Edition I got
a little confused about the allowed length for object names.

Did I understand this correct:

table names -> 128 characters (if ANSI characters)
column names -> 18 char.
primary key names -> 18 char.

In a web forum I found a hint that column names may be 30 characters
long, now I don't now if this is correct.


Correct are the limits that you find in the SQL Reference, Appendix A:
http://publib.boulder.ibm.com/infoce...n/r0001029.htm

Column names are 30 bytes
Constraint names are 18 bytes (a primary key is just a constraint)
Unqualified table names are 128 bytes
Schema names (to qualify tables) are 30 bytes; schema names for used-defined
types are restricted to 8 bytes

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.