DB2 Table Column Size

How to increase the column size from 30 charecters to 40. as iam getting error as Max limit is 30 charecters for a column.
SAKETHREDDYAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

momi_sabagCommented:
alter table xxx alter column_name char(40) / varchar(40)

depends if it is a varchar or a char column
0
SAKETHREDDYAuthor Commented:
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
momi_sabagCommented:
no, it can't be changed
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Kent OlsenData Warehouse Architect / DBACommented:
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
SAKETHREDDYAuthor Commented:
Thank you , if any solutions please let me know
0
Kent OlsenData Warehouse Architect / DBACommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB2

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.