Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us