博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ORA-01439: column to be modified must be empty to change datatype
阅读量:4684 次
发布时间:2019-06-09

本文共 541 字,大约阅读时间需要 1 分钟。

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

 

显示错误:

 

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

 

修改方法:

 

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

转载于:https://www.cnblogs.com/lykbk/p/fefefefefefef3343434343.html

你可能感兴趣的文章
c语言基础知识要点
查看>>
node启动时, listen EADDRINUSE 报错;
查看>>
杭电3466————DP之01背包(对状态转移方程的更新理解)
查看>>
kafka中的消费组
查看>>
python--注释
查看>>
前端资源链接 ...
查看>>
yum install ntp 报错:Error: Package: ntp-4.2.6p5-25.el7.centos.2.x86_64 (base)
查看>>
leetcode-Single Number-136
查看>>
CF715C Digit Tree
查看>>
二分法练习1
查看>>
QT 制作串口调试小助手----(小白篇)
查看>>
前端MVC实践之hellorocket——by张舒彤
查看>>
OptimalSolution(2)--二叉树问题(3)Path路径问题
查看>>
IPC 之 Messenger 的使用
查看>>
macos 下usb键盘问题.
查看>>
SQL函数学习(十六):STUFF()函数
查看>>
Apache Hadoop 和Hadoop生态圈
查看>>
Ctrl+Enter 选中文本提交
查看>>
android WIFI
查看>>
常用的匹配正则表达式和实例
查看>>