Alter multiple tables' columns length
        Posted  
        
            by 
                gdoron
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by gdoron
        
        
        
        Published on 2012-09-05T09:36:56Z
        Indexed on 
            2012/09/05
            9:37 UTC
        
        
        Read the original article
        Hit count: 256
        
So, we just found out that 254 tables in our Oracle DBMS have one column named "Foo" with the wrong length- Number(10) instead of Number(3).
That foo column is a part from the PK of the tables.
Those tables have other tables with forigen keys to it.
What I did is:
- backed-up the table with a temp table.
- Disabled the forigen keys to the table.
- Disabled the PK with the foocolumn.
- Nulled the foocolumn for all the rows.
- Restored all the above
But now we found out it's not just couple of tables but 254 tables.
Is there an easy way, (or at least easier than this) to alter the columns length?
P.S. I have DBA permissions.
© Stack Overflow or respective owner