Good evening!
Personal, currently in my work, I have to generate multiple .txt files to be exported to the bank of another company.
I flip this in hand and that sucks, every day I run, wait to send and everything.
I tried to do the spool command as follows:
spool \10.0.0.1\diretorio\arquivo.txt
select * from schema.tabela_qualquer;
spool off;
The file was generated on this server, all right. Following this same line of reasoning, that I could generate this file on any computer on the network, I thought of doing a job that would do this service for me directly and the other company's boy would go there and pick up the file.
However, if I had to do:
BEGIN
dbms_scheduler.create_job('"exporta_arquivos"',
job_type=>'PLSQL_BLOCK',
job_action=>'spool \10.0.0.1\diretorio\arquivo.txt; select * from schema.alguma_tabela; spool off;',
number_of_arguments=>0,
start_date=>TRUNC(SYSDATE,'HH'),
repeat_interval=> 'FREQ=MINUTELY;INTERVAL=5',
end_date=>NULL,
job_class=>'"DEFAULT_JOB_CLASS"',
enabled=>FALSE,
auto_drop=>FALSE,
comments=> 'Job que faz a exportação de arquivos');
END;
/
or
If instead of
job_action=>'spool \10.0.0.1\diretorio\arquivo.txt; select * from schema.alguma_tabela; spool off;'
I try to make a procedure and try to call it by job_action, it ends up returning me error as if I could not spool because of the bars '\ 10.0.0.1' indicating that I'm going to play on the server.
Would you have any way to do this?