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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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