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
 
please let me know how do we insert a new field in the table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Suvendu.test

New User


Joined: 04 Feb 2006
Posts: 4

PostPosted: Sat Feb 04, 2006 10:07 pm    Post subject: please let me know how do we insert a new field in the table
Reply with quote

Also please let me know what are the things to be taken care of in a DB2-COBOL program if we insert a new field in the table and if the table is used in a cobol pgm, what are the changes require in the program.
Back to top
View user's profile Send private message

pa1chandak
Currently Banned

New User


Joined: 31 Jan 2006
Posts: 55

PostPosted: Mon Feb 06, 2006 9:45 am    Post subject:
Reply with quote

no changes write the insert query in exec sql and end-exec



pawan
Back to top
View user's profile Send private message
sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Mon Feb 06, 2006 3:27 pm    Post subject: Re: please let me know how do we insert a new field in the t
Reply with quote

hi

when adding a new record u need to do insert statement. but in this case u want to insert a new fields which means if u have eid, ename and now u want to add a field esal, then u need to alter the table and replace existing dclgen. then compile and bind. pl corect me if iam worng
Back to top
View user's profile Send private message
sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Mon Feb 06, 2006 3:29 pm    Post subject: Re: please let me know how do we insert a new field in the t
Reply with quote

hi

when adding a new record u need to do insert statement. but in this case u want to insert a new fields which means if u have eid, ename and now u want to add a field esal, then u need to alter the table and replace existing dclgen. then compile and bind. pl corect me if iam worng
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Mon Feb 06, 2006 3:40 pm    Post subject:
Reply with quote

Hai,
If u want to add a new field to a table means first create a new table with all the old Fields and new field. Insert all the records from the old table to this new table. drop the old table. rename the new table as old table.
Then change the prog according to the new field then create new dclgen and again go for compile and bind.
I think if u are not using this new field in ur program means there is no prg changes.
Back to top
View user's profile Send private message
rambabu
Currently Banned

New User


Joined: 18 Apr 2005
Posts: 67

PostPosted: Mon Feb 06, 2006 4:50 pm    Post subject: Re: please let me know how do we insert a new field in the t
Reply with quote

I think it is working.
Alter table table name <column name data type(size)>
ex:alter table emp(ename char(36))
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

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