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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Pl/Sql renaming columns

Re: Pl/Sql renaming columns

From: Alexandre Gorbatchev <alexandre.gorbatchev_at_avermann.de>
Date: Wed, 19 Jun 2002 08:18:25 -0800
Message-ID: <F001.00481538.20020619081825@fatcity.com>


Any name in oracle must start with letter A...Z

if you are on the 9.2, you may use ALTER TABLE ... RENAME COLUMN ... TO .... Check documentation for any implications - dont remeber them. In PL/SQL you should use EXECUTE IMMEDIATE to run this DDL statement.

If you are on an older version than it's not so straitforward. You may add newcolumn, copy values and drop old column. This could jeopardise you storage but should work. (dont remember since which version you can drop column. 8.0 or 8i? in older versions you need to drop a table) You should be careful about constraints and other things like stored pl/sql, though. Be especially careful when you do it automatically. Advice - don't do it in production. Even if at the moment this is fine, some developer later may left side effects unnoticed.

--
hth
Alexandre
----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
Sent: Wednesday, June 19, 2002 4:33 PM



>
> That's an invalid column name format.
>
> 1* create table junque (&&1 date);
>
> Enter value for 1: 19-jun-02
> old 1: create table junque (&&1 date)
> new 1: create table junque (19-jun-02 date)
> create table junque (19-jun-02 date)
> *
> ERROR at line 1:
> ORA-00904: invalid column name
>
> But the example above should give some ideas on how it could be done.
>
>
>
>
> Roland.Skoldb
> lom To: Multiple recipients of
list ORACLE-L
> @ica.se <ORACLE-L_at_fatcity.com>
> Sent by: root cc:
> Subject: Pl/Sql renaming
columns
>
> 06/19/2002
> 07:23 AM
> Please
> respond to
> ORACLE-L
>
>
>
>
>
>
> Hallo,
>
> Anyone who has any good hint on how to write pl/sql if i wantto chang ethe
> name
> of the fields everytime the procedur runs?
> The field names should be 1-JULI-2002 the first time the procedur runs,
the
> next time the procedur runs the name of procedur should be 1-AUG-2002 etc.
> Please help me with this.
>
> I have tried to look in the manual, but cant find any clue.
>
> Thanks in advance
>
> Roland
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: Roland.Skoldblom_at_ica.se
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Thomas Day
> INET: tday6_at_csc.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Alexandre Gorbatchev INET: alexandre.gorbatchev_at_avermann.de Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Wed Jun 19 2002 - 11:18:25 CDT

Original text of this message

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