Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Modify a cloumn data type

    hi everyone i am new on Oracle...


    i created a table
    create table UNI
    (UNAME varchar2(1),
    UNIID number(5),
    UADDRESS varchar2(20),
    URANK number(4),
    PCode number(4)
    );
    the problem on first line
    UNAME varchar2(1)
    i want change this
    UNAME varchar2(12)

    plz help me out this problem..
    thanks..
    Last edited by crystal mind; 12-29-12 at 10:54.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    12,434
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2012
    Posts
    3
    i did this ...
    but not succeeded

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,622
    Code:
    DROP TABLE UNI;
    CREATE TABLE uni 
      ( 
         uname    VARCHAR2(12), 
         uniid    NUMBER(5), 
         uaddress VARCHAR2(20), 
         urank    NUMBER(4), 
         pcode    NUMBER(4) 
      );
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    There are no stupid questions, but there are a LOT of Inquisitive Idiots.

  5. #5
    Join Date
    Dec 2012
    Posts
    3
    I know this situation and have done many times....
    but u did not get my point...
    i apply
    alter.....modify
    alter ....drop column etc...
    but these are not working so i asked to u ppl how can i remove this one...

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,622
    >but these are not working

    my car is not working.
    tell me how to make my car go.

    It is difficult to say what you are doing wrong when we have NO idea what exactly you are actually doing.

    is COPY & PASTE broken for you?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    There are no stupid questions, but there are a LOT of Inquisitive Idiots.

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,622
    Code:
    SQL> CREATE TABLE uni
      2    (
      3       uname    VARCHAR2(1),
      4       uniid    NUMBER(5),
      5       uaddress VARCHAR2(20),
      6       urank    NUMBER(4),
      7       pcode    NUMBER(4)
      8    );
    
    Table created.
    
    SQL> desc uni
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     UNAME                                              VARCHAR2(1)
     UNIID                                              NUMBER(5)
     UADDRESS                                           VARCHAR2(20)
     URANK                                              NUMBER(4)
     PCODE                                              NUMBER(4)
    
    SQL> alter table uni modify uname varchar2(12);
    
    Table altered.
    
    SQL> desc uni
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     UNAME                                              VARCHAR2(12)
     UNIID                                              NUMBER(5)
     UADDRESS                                           VARCHAR2(20)
     URANK                                              NUMBER(4)
     PCODE                                              NUMBER(4)
    
    SQL>
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    There are no stupid questions, but there are a LOT of Inquisitive Idiots.

Posting Permissions

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