如果你不想(或不能)
export and import你的数据,并且真的想要它作为一组插入语句,你可以使用sql Developer的内置格式化工具自动将你的CLOB拆分成多个足够小的块.作为字符串文字有效,然后将结果假脱机到文件:
原文链接:https://www.f2er.com/oracle/205179.htmlspool 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
生成的insert语句如下所示:
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 ...'));