By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

alter table

P: 2
which are all the components get affected when you alter a table by inserting a column in your db2 program.say you are using cobol,db2 and jcl.
Mar 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: 24
Depends on the construction of the table you are updating. But say it is a basic table with one index. When you add a row to the table Db2 will create and add a new row to the index. Until these changes are committed the new record will be locked. Depending on the "lock level" you have set this may just affect the one row or could affect all the rows on the current page.

By calling a piece of SQL in DB2 from an application program (in your example COBOL) you will have also loaded the "DB2 package" from the system catalogue into the DB2 subsystem. The DB2 package is basically an interpretation of the SQL you wrote in the COBOL program which is created when you BIND the DBRM into the database. You will also be affecting the DB2 logs as the activity will be recorded.

Hope that was what you were after,

Regards

Snib
Mar 16 '07 #2

P: 24
Sorry, I read ROW instead of column so please ignore my previous response as it is definitely wrong!

If you are altering a table structure in a COBOL program then you will be affecting the SYSCOLUMNS catalogue table. You will potentially, via relationships in SYSPACKDEP, also invalidate 1 or more packages that use the table. You will also affect changes to SYSTABLES ( I think - can't find my reference guide to check the columns on the SYSTABLES table!).

Not really adviced as part of an application process as any dependant SQL could start failing on INSERTs or UPDATEs due to the new column - depends on how you define the default value for the new column.

heop that helps, apologise about the other rubbish post!

Snib
Mar 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.