修改数据库字段类型,但是由于数据表已经存在数据,无法修改;

显示错误:

 写道
ORA-01439: column to be modified must be empty to change datatype

修改方法:

    1. alter table web_app_base add tmp_col varchar2(3999);-- 添加临时列
    2. update web_app_base set tmp_col = C_EDR_CTNT ; --将目标字段中数据加入到临时列中
    3. update web_app_base set C_EDR_CTNT = null; --将目标字段数据清空
    4. alter table web_app_base modify (C_EDR_CTNT long); --更改目标字段类型
    5. update web_app_base set C_EDR_CTNT = tmp_col; --将临时列数据加回到目标字段中
    6. alter table web_app_base drop column tmp_col; --清除临时列

ORA-01439: column to be modified must be empty to change datatype的更多相关文章

  1. ORA-01440: column to be modified must be empty to decrease precision or scale

    在修改表字段的NUMBER类型的精度或刻度时,你可能会遇到ORA-01440: column to be modified must be empty to decrease precision or ...

  2. Oracle中表列由VARCHAR2类型改成CLOB

    情景 原来表中的列定义成VARCHAR2类型,众所周知,VARCHAR2类型最大支持长度为4000.假设因为业务须要.想把此列转换为CLOB类型,在Oracle中直接通过ALTER语句转换是行不通的. ...

  3. Oracle对列的操作总结

    1.更改列名 alter table TABLE_NAME rename column COLUMN_OLD COLUMN_NEW; 2.添加列 alter table TABLE_NAME add ...

  4. Oracle中字段的修改操作语法

      对字段操作 操作方法 更新字段名 alter table TABLE_NAME rename column column_old to column_new; 添加字段 alter table T ...

  5. oracle数据库中修改已存在数据的字段

    在oracle中,如果已经存在的数据的某些列,假如要更换类型的话,有的时候是比较麻烦的, 会出现:ORA-01439: column to be modified must be empty to c ...

  6. Oracle 如何修改列的数据类型

    链接:http://www.cnblogs.com/david-zhang-index/archive/2012/04/10/2441015.html 对字段操作 操作方法 更新字段名 alter t ...

  7. oracle修改已存在数据的字段类型

    第一次使用oracle数据库,在通过Navicat premium工具修改字段类型时,发现报“ORA-01439: column to be modified must be empty to cha ...

  8. [Hive - LanguageManual] Alter Table/Partition/Column

    Alter Table/Partition/Column Alter Table Rename Table Alter Table Properties Alter Table Comment Add ...

  9. Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.

      1: /// <summary> 2: /// Write an algorithm such that if an element in an MxN matrix is 0, it ...

随机推荐

  1. Google Tensorflow 源码编译(一):Protobuf<v3.0.0-alpha-3>

    这几天终于把tensorflow安装上了,中间遇到过不少的问题,这里记录下来.供大家想源码安装的参考. 安装环境:POWER8处理器,Docker容器Ubuntu14.04镜像. Build Prot ...

  2. 也谈Oracle异常: ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小

    场景: .Net程序调用Oracle方法 command.ExecuteNonQuery()执行存储过程;弹出如标题异常信息. 存储过程有4个输入参数,一个输出参数.一旦执行到给输出参数赋值的时候就报 ...

  3. python xlwt,xlutils 在excel里面如何插入一行数据

    就是把插入行之后值重新输出来. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 import xl ...

  4. GDI+系列

    1.GDI+的概述 2.绘图表面 3.GDI+坐标系 4.用Pen对象画图 1.使用GDI+画线 2.使用GDI+画弧线 3.使用GDI+画曲线 4.使用GDI+画椭圆 5.使用GDI+画矩形.多边形 ...

  5. 企业架构(Enterprise Architecture)

    ylbtech-Miscellaneos: 企业架构(Enterprise Architecture) A,返回顶部 1, 简称EA.是指对企业事业信息管理系统中具有体系的.普遍性的问题而提供的通用解 ...

  6. mycat 插入语句导致的一个Dobbo问题

    2017-01-03 11:11:52.621 [com.alib] (): [DUBBO] Send heartbeat to remote channel /121.43.177.8:20192, ...

  7. main 方法,

    默认是设置是alt /   就是你打出main以后按(alt /)

  8. Aquarium Cycling

    http://www.fishyou.com/aquarium-cycling.php Aquarium Cycling Aquarium cycling actually refers to the ...

  9. ini 文件

    INI文件是一个无固定标准格式的配置文件.它以简单的文字与简单的结构组成,常常使用在视窗操作系统,或是其他操作系统上,许多程序也会采用INI文件做为设置程序之用.视窗操作系统后来以注册表的形式替换掉I ...

  10. Java分布式Socket监控项目思考

    内容说明 一项课程作业Java编写Socket长连接监控分布式终端,并将终端状态写入数据库供前端查询 基础:c++/Posix/APUE/Mysql&sqlite 核心内容:Socket/线程 ...