Home » SQL & PL/SQL » SQL & PL/SQL » change of column and table name
change of column and table name [message #21416] Thu, 01 August 2002 22:23 Go to next message
meena
Messages: 36
Registered: December 2000
Member
How do I change the column and table name without droping and recreating them. Urgent. Please help.

Thanks in advance
meena
Re: change of column and table name [message #21417 is a reply to message #21416] Thu, 01 August 2002 23:24 Go to previous messageGo to next message
venkatesh
Messages: 72
Registered: August 2000
Member
hi

u can try this

rename <old table name> to <new table name>

with regards
venki
Re: change of column and table name [message #21422 is a reply to message #21417] Fri, 02 August 2002 04:41 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> desc dept;
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ----------------------------
 DEPTNO                                                         NUMBER(2)
 DNAME                                                          VARCHAR2(14)
 LOC                                                            VARCHAR2(13)

 SQL> ed
Wrote file afiedt.buf

  1  create table my_dept
  2  (my_deptno number,
  3   my_dname varchar2(14),
  4*  my_loc varchar2(13))
SQL> /

Table created.

SQL> insert into my_dept
  2  (select deptno,dname,loc from dept);

4 rows created.

SQL> select * from my_dept;

 MY_DEPTNO MY_DNAME       MY_LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL> commit;

now you can drop the old table (DEPT)
Re: change of column and table name [message #21449 is a reply to message #21416] Sun, 04 August 2002 00:29 Go to previous message
yogesh kotiyal
Messages: 2
Registered: August 2002
Junior Member
rename old table name to new table name

syntax is

rename old_table_name to new_table_name.
Previous Topic: can I use FOR..LOOP within IF..THEN..ELSIF statement
Next Topic: Oracle projects
Goto Forum:
  


Current Time: Fri Apr 26 16:37:29 CDT 2024