Unix Technical Forum

Problem in Automatically generated columns while copying schema

This is a discussion on Problem in Automatically generated columns while copying schema within the DB2 forums, part of the Database Server Software category; --> Hi, I have a table where one of the columns is automatically generated as a substring of values of ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 02:04 PM
Rahul B
 
Posts: n/a
Default Problem in Automatically generated columns while copying schema

Hi,

I have a table where one of the columns is automatically generated as
a substring of values of some other column.
When i create a copy of that schema using sysproc.admin_copy_schema,
the table goes in pending state, because the data in the table was
inserted fully and the column was not automatically generated(i think
this is the reason).

I tried to get it out of pending state by issuing "SET
Integrity........." and Reorg table ......." commands.
But nothing worked.
I can't even delete data from that table, nor do a select or update.

So i had to resort to drop that table, and in turn drop a few procs/
funcs to drop that.
then recreate that table with DDL scripts, recreate other procs/
funcs.

Finally, i had to insert data like
"Insert into schema2.table(col1, col2.................col(n-1)) select
col1, col2, col3, .....col(n-1) from schema1.table"

so that the column n was automatically generated.

I am quite sure, this was only a workaround and not the correct way(I
am working in a dev database, and not a prod one, so, the workaround
was quite effective).

Can anybody please help as how to tackle the problem in a correct way?

Thanks

Rahul

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:35 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com