如何在Oracle SQL Developer中导出Clob字段数据 [英] How to export clob field datas in oracle sql developer

查看:1376
本文介绍了如何在Oracle SQL Developer中导出Clob字段数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Oracle SQL Developer中导出Clob字段数据.目前,Clob字段数据无法在oracle sql developer中导出.

How to export clob field data's in oracle sql developer. Currently clob field data's can't export in oracle sql developer.

推荐答案

如果您不想(或不能)

If you don't want to (or can't) export and import your data, and really want it as a set of insert statements, you can use SQL Developer's built-in formatting tools to automatically split your CLOBs into multiple chunks that are small enough to be valid as string literals, and then spool the result to a file:

spool clob_export.sql
select /*insert*/ * from your_table;
spool off

使用最新版本,您可以使用

With more recent versions you can use the sqlformat command to control the output format without needing to modify the query; this is equivalent:

set sqlformat insert
spool clob_export.sql
select * from your_table;
spool off

生成的插入语句将类似于:

The generated insert statements will look something like:

REM INSERTING into YOUR_TABLE
SET DEFINE OFF;
Insert into YOUR_TABLE (ID,CLOB_COLUMN) values (1,TO_CLOB('... up to 4k of characters with quotes escaped ...')
|| TO_CLOB('... up to 4k of characters with quotes escaped ...')
|| TO_CLOB('... up to 4k of characters with quotes escaped ...')
...
|| TO_CLOB('... up to 4k of characters with quotes escaped ...'));

这篇关于如何在Oracle SQL Developer中导出Clob字段数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆