db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Łyp (JIRA) <j...@apache.org>
Subject [jira] Commented: (DERBY-4681) Dropping a column in the table drops the views that use this table
Date Fri, 28 May 2010 13:36:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872972#action_12872972

Grzegorz Łyp commented on DERBY-4681:

My problem came out when I wanted to reduce the proecision of a numeric column from decimal(10,4)
to decimal(10,2).
Because derby does not allow to alter such columns, I created a column with new data type,
copied the data. Next I dropped the original column and created it again, then copied the
data from temporary column, and dropped temporary column.

alter table My_Tab add column tmp_col decimal(10,2)
update My_Tab set tmp_col = original_column
alter table My_Tab drop column original_column
alter table My_Tab add column original_column decimal(10,2)
update My_Tab set original_column = tmp_col 
alter table My_Tab drop column tmp_col

such operations resulted in droping views dependant od table My_Tab.

> Dropping a column in the table drops the views that use this table
> ------------------------------------------------------------------
>                 Key: DERBY-4681
>                 URL: https://issues.apache.org/jira/browse/DERBY-4681
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions:
>         Environment: Windows 7 Enterprise, JDK SE 1.6 u20
>            Reporter: Grzegorz Łyp
>            Priority: Critical
> If i have a table and a view that uses this table, after dropping a column from this
table the whole view is also dropped.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message