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: How to change a field name?

Re: How to change a field name?

From: Heggelund <d92hegge_at_ix_prod.hfk.mil.no>
Date: 1997/03/24
Message-ID: <1997Mar24.143332.3592@ix_prod.hfk.mil.no>#1/1

Hi,

there is a quick way of doing this but it is not described in any manual nor is it supported by Oracle. But if you really need to change the column name you could do this.

Connect as internal or sys.

Find the tables obejct_number: select obj# from obj$ where name = 'table_name'; Then change the name in col$:
update col$ set name = 'new_name'
where obj# = 'object_number' -- retrieved previously and name = 'old_name'
/

alter system flush shared_pool; -- To get rid of the old dd information in

                                     the rowcache.

I have just done this a couple of times, and never in a production environment. I don't recommend updating the sys tables, but as far as I have seen it should work.

Rgds
Steinar Heggelund

Hadi (Force12_at_force12.com) wrote:
: Is there a quick way to change the name of a column/field in another
: user's table without having to create a copy of the table minus the
: column to be changed, then adding the column back in with the new name?
 

: Thanks in advance
: Hadi
: --
: Force12 Solutions Ltd

--

----------------------------------------------------------------------------
I'm employed in the Norwegian consulting company Opus One AS. 
I have 7 years experience with Oracle products, mainly the database. 
We are a small company which offers consulting services in design,
implementation and tuning of databases and applications based on Oracle.
Received on Mon Mar 24 1997 - 00:00:00 CST

Original text of this message

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