用 '' '' (两个单引号代替)
比如 :
sys@LEOdb(194)> select 'alter database tempfile '''||name||''' drop ;' from v$tempfile; 'ALTERDATABASETEMPFILE'''||NAME||'''DROP;' ---------------------------------------------------------------------------------------------------------------------------------------------------------------- alter database tempfile '+DATAC1/LEOdb/tempfile/temp.1461.900841159' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/auims3_tmp.1179.901536643' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/LEO_tmp.913.901536855' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/LEOhis_tmp.915.901536939' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/eimage_tmp.917.901536999' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/webuser_tmp.1475.902157001' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/LEO2_tmp.1477.902157105' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/LEOhis2_tmp.1479.902157169' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/eimage2_tmp.1481.902157567' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/ppf_tmp.1107.947784051' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/tab_livebos_tmp.1100.949074935' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/tab_sdx_tmp.1098.949075105' drop ; alter database tempfile '+DATAC1/LEOdb/tempfile/tab_stat_tmp.1093.949075261' drop ; alter database tempfile '+DATAC1/LEOdb/datafile/ostat_tmp.ora' drop ; alter database tempfile '+DATAC1/LEOdb/datafile/ods_tmp.ora' drop ; alter database tempfile '+DATAC1/LEOdb/datafile/dreport_tmp.ora' drop ; alter database tempfile '+DATAC1/LEOdb/datafile/dreport_tmp1.ora' drop ;