View previous topic :: View next topic
|
Author |
Message |
Suvendu.test
New User
Joined: 04 Feb 2006 Posts: 4
|
|
|
|
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 |
|
|
pa1chandak Currently Banned New User
Joined: 31 Jan 2006 Posts: 55
|
|
|
|
no changes write the insert query in exec sql and end-exec
pawan |
|
Back to top |
|
|
sunish
New User
Joined: 23 May 2005 Posts: 19
|
|
|
|
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 |
|
|
sunish
New User
Joined: 23 May 2005 Posts: 19
|
|
|
|
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 |
|
|
nuthan
Active User
Joined: 26 Sep 2005 Posts: 146 Location: Bangalore
|
|
|
|
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 |
|
|
rambabu Currently Banned New User
Joined: 18 Apr 2005 Posts: 67
|
|
|
|
I think it is working.
Alter table table name <column name data type(size)>
ex:alter table emp(ename char(36)) |
|
Back to top |
|
|
|