如何在Oracle SQL Developer中导出Clob字段数据 [英] How to export clob field datas in oracle sql developer
问题描述
如何在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屋!