Rename column name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganeshshegde
    New Member
    • Jun 2007
    • 8

    Rename column name

    How to rename the column?
    i entered "alter table student_19104 rename student_marks to stud_marks"
    But it's giving error "missing PARTITION or SUBPARTITION keyword "
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    that feature is available only in oracle version 10g.

    Comment

    • gintsp
      New Member
      • Aug 2007
      • 36

      #3
      Originally posted by ganeshshegde
      How to rename the column?
      i entered "alter table student_19104 rename student_marks to stud_marks"
      But it's giving error "missing PARTITION or SUBPARTITION keyword "
      You have invalid syntax i.e. lack keyword column
      Code:
      17:10:58 SQL> desc z
       Name                                      Null?    Type
       ----------------------------------------- -------- --------------------------
       FF                                        NOT NULL VARCHAR2(10 CHAR)
      
      17:58:39 SQL> alter table z rename column ff to gg;
      
      Table altered.
      
      Elapsed: 00:00:00.21
      17:59:27 SQL> desc z
       Name                                      Null?    Type
       ----------------------------------------- -------- --------------------------
       GG                                        NOT NULL VARCHAR2(10 CHAR)
      
      17:59:30 SQL>
      It is all written in oracle docs and you can find them http://tahiti.oracle.com

      Gints Plivna

      Comment

      • Mala232
        New Member
        • Jul 2007
        • 16

        #4
        The syntax is

        SQL> Alter table <tablename> rename column <old columnname> to <newcolumnname> ;

        good luck
        mala

        Comment

        • ganeshshegde
          New Member
          • Jun 2007
          • 8

          #5
          Hey,thanks it's working.

          Comment

          Working...