Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DB2 Table Column Size

Posted on 2008-11-12
8
Medium Priority
?
2,729 Views
Last Modified: 2012-05-05
How to increase the column size from 30 charecters to 40. as iam getting error as Max limit is 30 charecters for a column.
0
Comment
Question by:SAKETHREDDY
  • 2
  • 2
  • 2
6 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 22939787
alter table xxx alter column_name char(40) / varchar(40)

depends if it is a varchar or a char column
0
 

Author Comment

by:SAKETHREDDY
ID: 22940369
I am creating a table ADM_SNP with column  APPRP_ANTIBIOTIC_ADMINISTERED_F

CREATE TABLE ADM_SNP ( ADM_ID      BIGINT NOT NULL,
          APPRP_ANTIBIOTIC_ADMINISTERED_F      SMALLINT)
I am getting below error
SQL0107N  The name "APPRP_ANTIBIOTIC_ADMINISTERED_F" is too long.  The maximum
length is "30".  SQLSTATE=42622
I can reduse this but ..i have to update so many columns like this .
so is any chance to increase the max length from length 30 to 40  in z/Os system in DB2 V9.1

Advance thanks
0
 
LVL 37

Accepted Solution

by:
momi_sabag earned 100 total points
ID: 22940526
no, it can't be changed
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 100 total points
ID: 22941169
Hi SAKETHREDDY,

The maximum length for a column name can not be changed.  It's "hard coded" into DB2.

All of the table definitions are stored in DB2 tables.  (On DB2/LUW check the SYSIBM.TABLES view.)  Since the user defined names must fit into the DB2 defined tables, the name lengths are limited by the structure in the SYSIBM table.


Good Luck,
Kent
0
 

Author Comment

by:SAKETHREDDY
ID: 23171203
Thank you , if any solutions please let me know
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 23172953
Hi SAKETHREDDY,

The solution is to shorten the name that you want to use as the column name.  DB2 has no provision for handling names longer than will fit into its own internal table(s).


kent
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question