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
 

 

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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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