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
生成的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 ...'));