467,199 Members | 1,006 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,199 developers. It's quick & easy.

Maximum length for table names, colums etc.

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
  • viewed: 31890
Share:
1 Reply
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.

Similar topics

reply views Thread by Tobias | last post: by
14 posts views Thread by olekristianvillabo@gmail.com | last post: by
1 post views Thread by Alan Foxmore | last post: by
3 posts views Thread by hug | last post: by
7 posts views Thread by Martin Pöpping | last post: by
2 posts views Thread by Paul Johnston | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.