SQL - DELETE A COLUMN FROM A TABLE WITHOUT CHANGING THE ENVIRONMENT

Goti Bandu

Total Post:119

Points:835
Posted by  Goti Bandu
 1034  View(s)
Ratings:
Rate this:
Hi Everyone!

I'm working in a Oracle SQL database, quite big database. One of (among 150 tables) this table has to be changed because it's redundant (it can be generated through a join). I'm asked to delete a column from this table, to get rid of the redundancy. The problem is that now I have to change code everywhere someone made a insert/update/etc on this table (and don't forget the contraint!). I thought "I can make a view that do the right join" so the problem it's solved for all the select, but it's not working for the insert, because I'm updating 2 tables... Is there a way to solve this problem? My goal is to rename my original table "original_table" in "original_table_smaller" (with one less column) and create a view (or something like a view) called "original_table" that work like the original table. Is this possible? 

Thanks!
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: SQL - Delete a column from a table without changing the environment

    Hi Goti!

    Check with this query:

    select * from user_updatable_columns where table_name = 'VIEW_NAME';

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!