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

显示错误:

 写道
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. Django教程

    开发环境:Centos7,Django 1.10,Python 2.7 Django入门 本教程内容大部分来源于Django官网,有翻译不到位的欢迎大家指正,这部分的内容有助于新手快速搭建一个网站,让 ...

  2. Mac 下 Intellij IDEA 2016.1.2+maven+jetty+ JRebel 6.4.3 破解+spring mvc

    准备阶段:  Intellij IDEA 2016.1.2 (官方下载,作者下载的是社区版): JRebel for IntelliJ插件安装,可选择在线安装,在线安装的是最新版,我选择本地安装, 下 ...

  3. mysql的ONLY_FULL_GROUP_BY语义 --转自http://www.wtoutiao.com/p/19dh3ec.html

    执行SET GLOBAL sql_mode = ''; 把sql_mode 改成非only_full_group_by模式.验证是否生效 SELECT @@GLOBAL.sql_mode 或 SELE ...

  4. 转:Elasticsearch TermQuery 详解

    JavaClient 查询ES QueryBuilder queryBuilder = QueryBuilders.termQuery("字段","term值" ...

  5. JSONP理解和使用

    一.代码使用: $.ajax({ async:false, url: http://跨域的dns, type: "GET", dataType: 'jsonp'}); 二.理解: ...

  6. springfox.documentation.spi.DocumentationType配置示例

    Java Code Examples for springfox.documentation.spi.DocumentationType The following are top voted exa ...

  7. Hadoop学习19--推测式执行

    所谓推测式执行,就是计算框架判断,如果有一个task执行的过慢,则会启动备份任务,最终使用原任务+备份任务中执行较快task的结果.产生原因一般是程序bug.负载倾斜. 那么这个较慢,是怎么判断的呢? ...

  8. [转载]iOS 归档操作 NSCoding

    最近一个项目需要保存到本地文件,想用plist,但是发现很多内容是自定义的,于是只能自己归档接档.不难,找了一篇范文大家保存一下,方便以后学习使用. 转自:http://mobile.51cto.co ...

  9. 设置arc/非arc

    1,选择项目中的Targets,选中你所要操作的Target,2,选Build Phases,在其中Complie Sources中选择需要ARC的文件双击,     并在输入框中输入:-fobjc- ...

  10. 页面打开 抛出w3wp.exe 中发生未处理异常

    页面打开 抛出w3wp.exe 中发生未处理异常