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

最佳答案

如果您不想(或不能)export and import数据,并且确实希望将其作为一组插入语句,则可以使用SQL Developer的内置格式设置工具将CLOB自动拆分为多个块。小到足以用作字符串文字,然后将结果假脱机到文件中:

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


对于较新的版本,您可以使用the sqlformat command来控制输出格式,而无需修改查询。这是等效的:

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


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

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 - 如何在Oracle SQL Developer中导出Clob字段数据,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42244941/

10-08 21:54
查看更多