create or replace directory dir_temp as 'c:\temp';
grant write on directory dir_temp to ownerschema;
CREATE OR REPLACE PROCEDURE ownerschema.write_log (vcSQL in varchar2) AS
l_file utl_file.file_type;
nStr_len number;
nCtr number:=0;
nLineSize number:=255;
BEGIN
l_file := utl_file.fopen('DIR_TEMP' , 'searches.log', 'A');
nStr_len := length(vcSQL);
while nCtr < nStr_len
loop
utl_file.put_line(l_file, substr( vcSQL, nCtr +1, nLineSize ) );
nCtr := nCtr + nLineSize;
end loop;
utl_file.fflush(l_file);
utl_file.fclose(l_file);
END write_log;
|