Oracle SQL to change column type from number to varchar2 while it contains data

后端 未结 4 1180
广开言路
广开言路 2020-12-31 22:27

I have a table (that contains data) in Oracle 11g and I need to use Oracle SQLPlus to do the following:

Target: change the type of column TEST1 in table

4条回答
  •  我在风中等你
    2020-12-31 23:02

    Look at Oracle's package DBMS_REDEFINE. With some luck you can do it online without downtime - if needed. Otherwise you can:

    • Add new VARCHAR2 column
    • Use update to copy NUMBER into VARCHAR2
    • Drop NUMBER column
    • Rename VARCHAR2 column

提交回复
热议问题