Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Global table alter

Re: Global table alter

From: Jim Kennedy <jim>
Date: Fri, 7 Jul 2006 07:33:01 -0700
Message-ID: <wNednfQoBPht8jPZnZ2dnUVZ_sSdnZ2d@comcast.com>

"Randy Harris" <please_at_send.no.spam> wrote in message news:s7mrg.167518$F_3.5986_at_newssvr29.news.prodigy.net...
> I need to alter the width of a field that appears in many tables. Does
> anyone know of sample code that will search the entire schema for all
> tables with a field by that single name and modify it? I'm using 9.2.0.6.
>
> Thanks for any suggestions.
>
> --
> Randy Harris
> tech at promail dot com

something like:
spool mod_columns.sql
select 'alter '||owner||'.'||table_name||' modify THECOLUMN varchar2(98);' from dba_tab_columns where

    THECOLUMN_NAME='THECOLUMN' order by table_name,owner;

spool off
@mod_columns.sql

Jim Received on Fri Jul 07 2006 - 09:33:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US