How to change the datatype of a column having lots of data.

My table :: select hrm_employeeentitlement_id, amount FROM hrm_employeeentitlement;
need to change the Amount column :(
From :: amount Number(18,0)
To :: amount Number(10,2)
I am using 10XE
thanks in advance
w\

create a "temp" backup of your table, drop the original and create a new table. Fill this one with the "temp"
SQL> create table t
  2  (amount number (18,0))
  3  /
Table created.
SQL> insert into t
  2  select rownum
  3    from all_objects
  4   where rownum <= 10
  5  /
10 rows created.
SQL> commit
  2  /
Commit complete.
SQL> alter table t
  2  modify (amount number (10,2))
  3  /
modify (amount number (10,2))
ERROR at line 2:
ORA-01440: column to be modified must be empty to decrease precision or scale
SQL> create table temp
  2  as
  3  select *
  4    from t
  5  /
Table created.
SQL> drop table t
  2  /
Table dropped.
SQL> create table t
  2  (amount number (10,2))
  3  /
Table created.
SQL> insert into t
  2  select *
  3    from temp
  4  /
10 rows created.
SQL> drop table temp purge
  2  /
Table dropped.

Similar Messages

  • My Hard Disk setting has been changed into no access for everyone and i can't open my mac. please tell me how can i login as an admin to change the setting cause i have a lot of date in my hard drive.

    My Hard Disk setting has been changed into no access for everyone and i can't open my mac. please tell me how can i login as an admin to change the setting cause i have a lot of date in my hard drive.

    Read and follow Apple Support Communities contributor Niel's User Tip: kmosx: I accidentally set a disk's permissions to No Access

  • How to change the datatype in the oracle table?

    Hi,
    I need to change the datatype of the column in Oracle table. That column contains some data. I do not want to loose those data.
    For altering a table/column condition are:
    1. either table should not contain any data.
    2. either that column should not contain any data.
    Please suggest how i can handle this situation.
    Thanks.

    Hello,
    Suppose you have currently datatype of column as VARCHAR and you want to convert it in NUMBER. Do following
    1-Add another column with NUMBER datatype in your table.
    ALTER table tablename
    ADD testcolumn NUMBER;2-Update your actual column data to this test column.
    UPDATE tablename
    SET testcolumn = actualcolumn;
    COMMIT;3-Update your actual column data to null;
    UPDATE tablename
    SET actualcolumn = NULL;
    COMMIT;4-Change Datatype of actual column.
    ALTER table tablename
    MODIFY actualcolumn NUMBER;5-Update actualcolumn to testcolumn
    UPDATE tablename
    SET actualcolumn = testcolumn;
    COMMIT;
    please mark if it help you or correct
    Regards,
    Danish

  • How to change the width of a column in the web templete

    hai
       can anyone pl help me to solve the issue
    here is the issue
        " how to change the width of the column in web templete?" is there any chance  to change
    thanx in advance
    syam

    First use the Active Cell property and set the row value to -2 to change an entire column. The attached image shows how to set the background color of column 3 to green. I don't understand your comment about column size. It doesn't matter how wide or narrow a column is. Using the Cell Background Color property, the entire cell is colored. If you are having difficulty keeping track of the number of columns, thats a different issue.
    Attachments:
    Background_Color_of_Table.jpg ‏5 KB

  • Smartforms - how to change the with of a column in main

    Hi all,
    How do I go about to make one column in the main wider so that the whole column title is fit on one line? E.g.:
    how it is:    
    tax amou
    nt
    how I want it to be:
    % tax amount
    Thanks in advance for all the helpful answers!
    BR,
    Armin

    Armin,
    Check the Template of the MAIN window under which you will be able to change the width  of the column in the Table Painter Details.
    K.Kiran.

  • Somebody knows how to change the Iphone 3gs to 4s without missing my data?

    I need to change my Iphone 3gs to 4s without missing my data,....Please I need help!!!

    Just follow the directions here:
    http://support.apple.com/kb/ht2109

  • How to change the location of a column in a Oracle table?

    Sir:
    I want to add a new column in a table, but I dont want to add the column at the last of the table, how can I do it ? If I want to modify the locations of columns in a table, How can do it?
    Thanks

    You can't modify the order of columns in a table, though there shouldn't be any particular reason to care about the order of columns.
    You can always create a view over the table that SELECT's the columns in the order you want, though.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to change the font size of Column Heading  in webdynpro java

    Hi,
    I have a table with 4 columns, Can any one tell me how can i increase the text size and apply different fonts in webdynpro java application.
    Thanks
    Satish J

    Hi Satish,
    To expain it bit more clearly.
    Copy the images you need to use in the application
    Open your application in package explorer<Navigator>
    Now Expend node  src -> mimes -> components -> your application name with full package now right click on it and paste all the images here.
    Now go to web Dynpro prospective and use the  image name  (full name of image like columnName.jpg )to assign it to imageSource  property of the  Table_Header (Caption Header). The image will be seen.
    Hope this will clarify.
    Regards
    Narendra

  • How to change the order of report columns

    Hi guys,
    I am newbie to the Apex 3.2. I am not finding option to resequence the column display. e.g.
    My columns shown as Org ID, Create Date, Update Date, Name.
    I want to change it to Org ID, Name, Create Date, Update Date.
    This in tabular form. Any help would be much appriciated.
    Thanks
    Sushil

    Hello Sushil,
    Go to Edit Page XX link at the bottom of the page. In the edit page under the Regions section you will see your tabular form listed. Click on the "Report" link next to your tabular form link. You will see all the report columns with up and down arrow images to the right of the columns. Just click on the images to move the columns as you like and then click on "Apply Changes" button to save the changes. Run your page and you will see the changes.
    Thanks,
    Machaan
    P.S: Please assign correct answer points if this helped you with your problem :)

  • How to change the Size of a Column in TimesTen

    I have a Column of type VARSHAR2(32). I would like to increase the size to 255;
    Is the only to do this is to drop the table and add it again?

    Dropping and re-creating the table is by far the best way (of course you need to unload the table's data to a flat file with ttBulkCp first and then reload it again afterwards).
    a second option is to drop the column and re-add it with the new size but you still need to preserve the data first and put it back afterwards and this is harder for a single column than for a whole table. Also, if you are using replication you should exercise care when using ALTER TABLE to ensure iall replicated copies of the table maintain the same physical structure.
    Chris

  • How to identify the datatype of a column

    Hi
    I want to check whether the value of a particular column is numeric or non-numeric.
    What can I do for it?
    Is there any built in function in Oracle to check whether any value is numeric or non-numeric.
    So I want to do like:
    select 'X' from dual where '62546ghg' =<<Numeric>
    select 'Y' from dual where '62546ghg' =<<non-numeric>
    Thanks
    Deepak

    There is no built-in IS_NUMBER but you can easily write your own. The standard version of this would be:
    SQL> CREATE OR REPLACE FUNCTION is_number
      2      ( p_testnum VARCHAR2 )
      3      RETURN INTEGER
      4  AS
      5      v_testnum NUMBER;
      6  BEGIN
      7      v_testnum := p_testnum;
      8      RETURN 1;
      9  EXCEPTION
    10      WHEN OTHERS THEN RETURN 0;
    11  END is_number;
    12  /
    Function created.
    SQL> SELECT IS_NUMBER(-4.321e3) AS "Numeric?" FROM dual;
      Numeric?
             1
    1 row selected.
    SQL> SELECT IS_NUMBER('Banana') AS "Numeric?" FROM dual;
      Numeric?
             0
    1 row selected.Alternatively:
    SQL> CREATE OR REPLACE PACKAGE test_pkg
      2  AS
      3      FUNCTION is_number
      4          ( p_testnum VARCHAR2 )
      5          RETURN INTEGER;
      6
      7      FUNCTION is_number
      8          ( p_testnum NUMBER )
      9          RETURN INTEGER;
    10  END test_pkg;
    11  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY test_pkg
      2  AS
      3      FUNCTION is_number
      4          ( p_testnum NUMBER )
      5          RETURN INTEGER
      6      IS
      7      BEGIN
      8          RETURN 1;
      9      END is_number;
    10
    11
    12      FUNCTION is_number
    13          ( p_testnum VARCHAR2 )
    14          RETURN INTEGER
    15      IS
    16      BEGIN
    17          RETURN 0;
    18      END is_number;
    19
    20  END test_pkg;
    21  /
    Package body created.
    SQL> SELECT test_pkg.IS_NUMBER(-4.321e3) AS "Numeric?" FROM dual;
      Numeric?
             1
    1 row selected.
    SQL> SELECT test_pkg.IS_NUMBER('Banana') AS "Numeric?" FROM dual;
      Numeric?
             0
    1 row selected.

  • HT2470 Why does this not explain how to change the sort order?

    Why does this (i.e. support at Apple.com) not explain how to change the sort order? I can "arrange" by Date Modified for example but it won't let me switch to use most recent dates first. Also, what is Apple-speak for arrange versus sort anyway? It seems I used to be able to click on a column heading in finder and get a drop down arrow allowing me to change the sort sequence.

    Arrange roughly translates to "group the items in the folder." Sort is how each group is ordered. If you have arrange set to none, you can sort by anything. However, there is no way in the Arrange/Sort menu to choose the direction. The only way to do that is in the List View, and you must have Arrangement set to None.
    I've submitted an Enhancement Request to allow choosing sort direction from the Arrange/Sort menu, but I haven't ever gotten a response, which is good and bad. Good because they will often respond that they have considered it and don't plan on implementing. Bad in that they've haven't implemented it.

  • How to change the languaje in Audition?

    How to change the languaje in Audition?

    A lot of the information about this is stored in the registry. This means that you have to do a complete uninstall and reinstall, selecting the language that you want when offered the option. Sounds like a lot of work, but actually it's pretty easy and quick.

  • How to change the year in a range of column dates to the new year?

    How to change the year in a range of column dates to the new year?

    Depends on the pattern of the dates. The last procedure will work for any pattern, or no pattern at all.
    For examples.the dates are assumed to be in column A, starting at A2
    Sequential dates?
    Enter first updated date in the first cell.
    Enter =A2+1 in cell A3. Copy the cell.
    Select A3 to the end of the list. Paste.
    With the cells still selected, Copy, then go Edit > Paste Values.
    Evenly spaced dates?
    Same procedure as above, but replace +1 in the formula with + and the number of days between dates in the list.
    Randomly spaced dates?
    Select cell B2. Press option-left arrow to insert a (temporary) column to the left of column B.
    Click on the empty cell B2 in the new column. Enter the formula below:
    =DATE(YEAR(A)+1,MONTH(A),DAY(A))
    Copy the cell, then select B2 - Bn where n is the last ow containing a date to be converted. Paste,
    With the cells still selected, Copy.
    Click on A2, then go Edit > Paste values.
    Click on the column B reference tab to select all of column B.
    Hover the mouse over the right end of the reference tab, and click the black triangle when it appears.
    Choose Delete Column from the menu that appears.
    Regards,
    Barry

  • How do I change the number of picture columns in a folder

    how do I change the number of picture columns in a folder

    Never mind.  I found the answer.  For those who may wonder: you slide the cursor on the bottom right.  I looked in IPhoto help but there was nothing there.

Maybe you are looking for