Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: renaming a column
Pascal
Any direct update to the data dictionary that is not one asked for by Support is completely unsupported. If you want to rename a column, you need to either:
HTH. Pete
Pascal Byrne wrote:
> DBS: Oracle 8.0.4
> OS: Solaris 2.5.1
>
> Hi All,
>
> I'm trying to write a script to rename a column in a table. The
> following method seemed to work:
>
> obj_num= select obj# from sys.obj$ where type#=2 and name=<old_name> and
> owner# = <userid>;
> update sys.col$ set name=<new_colname> where obj#=obj_num and
> name=<old_colname>;
>
> After running this and restarting the database, 'desc table' reflects
> the changes and DML commands seem to work normally. However when I try
> to create a new type in a PLSQL procedure with '%rowtype' syntax and
> access the new column names, I get an error saying invalid column name.
>
> Is there something else that needs to be updated in addition to (or
> instead of) these tables?
>
> Thanks,
> pascal
--
Regards
Pete
Received on Thu Jun 10 1999 - 11:12:30 CDT
![]() |
![]() |