---
title: "oracle如何变更varchar2类型的列为clob"
author: "cfan_haifeng"
date: "2014-12-26T16:05:11Z"
tags: []
categories: ["数据库"]
slug: "oracle-varchar2-clob"
draft: false
lastmod: "2014-12-26T16:05:57Z"
id: 2170398
url: "https://sunfish.iteye.com/blog/2170398"
---

**目标**：将content表中的P2由varchar2变为为clob（直接alter是不行的）

直接指向下面的语句就行

 

```
/****创建临时列P2CLOB  **/
alter   table   CONTENT   add(P2CLOB  CLOB );
/****数据填充  **/
update CONTENT  set P2CLOB=P2;
commit;
commit;

/****更换列名字  **/
alter table CONTENT rename column P2 to P2BAK;
alter table CONTENT rename column P2CLOB to P2;
```