2019-07-26 輸出查詢到文本

create or replace Directory FILEWRITE as 'X:\';

? grant read,write on Directory FILEWRITE to public;?

? declare

? ? fileID utl_file.file_type;

? begin

? ? fileid := utl_file.fopen('FILEWRITE', 'xxx.xx', 'w');

? ? for REC in (select * from X.x) loop

? ? ? begin

? ? ? ? utl_file.put_line(fileid, Rec.Bcpcmd);

? ? ? end;

? ? end loop;

? ? utl_file.fclose(fileID);

? ? if utl_file.is_open(fileID) then

? ? ? utl_file.fclose(fileID);

? ? end if;

? end;

/

exit;?

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容