4 Replies Latest reply: Jan 25, 2013 12:01 PM by rp0428 RSS

    Change Dataype in existing Table

    987140
      Hi,

      I need to change the dataype from
      varchar2( 10 Byte) to varchar2( 15 char) of 10 columns . These 10 column are suppose to store data with special character.What would be the effect on existing data.


      Thankyou
      Shweta

      Edited by: 984137 on Jan 25, 2013 3:55 AM

      Edited by: 984137 on Jan 25, 2013 3:56 AM
        • 1. Re: Change Dataype in existing Table
          Fran
          SQL> desc test1;
           Nombre                                    ┐Nulo?   Tipo
           ----------------------------------------- -------- ------------------
           OBJECT_NAME                               NOT NULL VARCHAR2(30)
           OBJECT_ID                                 NOT NULL VARCHAR2(20)
          
          SQL> alter table test1 modify object_name char(50);
          
          Tabla modificada.
          
          SQL> desc test1;
           Nombre                                    ┐Nulo?   Tipo
           ----------------------------------------- -------- ------------------
           OBJECT_NAME                               NOT NULL CHAR(50)
           OBJECT_ID                                 NOT NULL VARCHAR2(20)
          
          SQL>
          • 2. Re: Change Dataype in existing Table
            987140
            I dont have right to create a table.I just have select rights.
            • 3. Re: Change Dataype in existing Table
              Fran
              you need "alter table" privilege to modified datatypes of a table if you haven't you can do it.
              • 4. Re: Change Dataype in existing Table
                rp0428
                >
                I need to change the dataype from
                varchar2( 10 Byte) to varchar2( 15 char) of 10 columns . These 10 column are suppose to store data with special character.What would be the effect on existing data.
                >
                None - there will be no effect on existing data and it will only take a millisecond.

                Making the column larger is a data dictionary change and will only affect future data inserted into the column.
                >
                I dont have right to create a table.I just have select rights.
                >
                Then you cannot make the change you ask about. You will need to have someone else make the change.