Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is the query to change the attributes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
senthilkumarse
Warnings : 1

New User


Joined: 16 Sep 2005
Posts: 7

PostPosted: Fri Sep 23, 2005 4:30 pm    Post subject: querry for changing the attribute in spufi
Reply with quote

hello sir/madam,

thank for ur valuable article o have send to me, now i am having another doubt in DB2 . in db2 we will creat etable like ( create table emp(empno char(5)) ) now i want to change thae attribute means i want to change char(5) to char (7) or varchar (5) ) what is the querruy to change the attributes plz clarify my doubts
Back to top
View user's profile Send private message

ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Fri Sep 23, 2005 7:12 pm    Post subject: Re: What is the query to change the attributes
Reply with quote

ALTER COLUMN columnname SET DATATYPE VARCHAR (integer)

It Alters the definition of a column. Only the length attribute of an existing column with a VARCHAR data type can be changed. A column cannot be altered if it is used in a referential constraint or a view or has a field procedure routine. It also cannot be altered if it belongs to a table that has edit or validation routine, is defined with DATA CAPTURE CHANGES, or is a created temporary table.

check this link:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/5.10?DT=20010718164132

So, in your case you cannot alter the column, as it is fixed, that is, CHAR.

If you really want to alter the table then you can take a back up of the table and drop the table and recreate it with new column definitions and load the table back with backup data.

Hope this helps...

Cheers,
Kumar.
Back to top
View user's profile Send private message
senthilkumarse
Warnings : 1

New User


Joined: 16 Sep 2005
Posts: 7

PostPosted: Fri Sep 30, 2005 11:45 am    Post subject:
Reply with quote

thanks for ur valuable article

now i have one doubt what is AMP where we r using this in one interviem they asked to my friends he is not able to answer this so plz clear my doubt
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Fri Sep 30, 2005 12:43 pm    Post subject: Re: What is the query to change the attributes
Reply with quote

Hi Ikumar,

I am having doubt on this. Is it possible to change the Lenght of

Column in Mainframes?


Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
senthilkumarse
Warnings : 1

New User


Joined: 16 Sep 2005
Posts: 7

PostPosted: Fri Sep 30, 2005 1:34 pm    Post subject: Re: What is the query to change the attributes
Reply with quote

I am also having the same doubt on this, but i tried this i cant change it,
some others also replied the same thing for me that we cant change if u found out thae correct ans inform to me
Back to top
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Fri Sep 30, 2005 5:20 pm    Post subject: Re: What is the query to change the attributes
Reply with quote

Hi Suganthy,

we cannot change the length of the column in DB2 unless if it is a VARCHAR field (see my previous post on this).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us