DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to rename columns and constraints in 9.2

Hybrid View

  1. #1
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Here is how to rename columns and constraints in 9.2.0, something what was not possible in 9.0.1:

    Code:
    SQL> create table test(a1 sys.xmltype, a2 timestamp);
    
    Table created.
    
    SQL>  alter table test add constraint con_a2 primary key(a2);
    
    Table altered.
    
    SQL> alter table test rename constraint con_a2 to pk_a2;
    
    Table altered.
    
    SQL> set lines 64
    SQL> desc test
     Name                            Null?    Type
     ------------------------------- -------- ----------------------
     A1                                       SYS.XMLTYPE
     A2                              NOT NULL TIMESTAMP(6)
    
    SQL> alter table test rename column a1 to a1_xml;
    
    Table altered.
    
    SQL> desc test
     Name                            Null?    Type
     ------------------------------- -------- ----------------------
     A1_XML                                   SYS.XMLTYPE
     A2                              NOT NULL TIMESTAMP(6)
    
    SQL>
    Just noticed Tim's paper related to this topic:

    http://www.oracle-base.com/Articles/...straints9i.asp


    [Edited by julian on 05-22-2002 at 03:38 AM]
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  2. #2
    Join Date
    Dec 2001
    Posts
    221
    is it availale in release 1 ?
    Santosh Jadhav
    8i OCP DBA

  3. #3
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by sjadhavdba
    is it availale in release 1 ?
    No.
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  4. #4
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    No. It's a new feature of Release 2.

    Remember, changing a constraint name does not rename the supporting index. For consistency you should rename both.

    Cheers
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: oracle-base.com
    My blog: oracle-base.com/blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width