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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Rename table

Re: Rename table

From: Christopher Latta <nobody_at_nowhere.not>
Date: Thu, 17 May 2001 13:49:34 +1000
Message-ID: <PVHM6.2839$mA4.82311@ozemail.com.au>

I don't think you can rename a table. There are probably a few approaches that will achieve the result you want:

  1. Create a complete new table with the name/structure you want. Assuming it has the same structure, you can populate it with the following SQL: insert into newtable (select * from oldtable)

and then drop the oldtable.

2. Create a view of the table with the new name that you want: create view newname (field1, field2, ..., fieldn) as select * from oldtable

3. Create a synonym for the table:
create public synonym newname for oldtable

Leave out the "public" if you only want the name for that schema.

4. Maybe you could do something with a stored procedure or function to do what you want.

HTH,
Christopher Latta

zifeng li <zifeng.li_at_compudigm.co.nz> wrote in message news:3B033FB5.79BA9568_at_compudigm.co.nz...
> How to rename a table? Thanks. Zifeng
>
Received on Wed May 16 2001 - 22:49:34 CDT

Original text of this message

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