IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

please let me know how do we insert a new field in the table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top