Answer the question
In order to leave comments, you need to log in
PL/SQL - SQL Query Task Scheduler?
Hello.
Please tell me, there is a sql query, I use it to get data from the database, how to do it in order to parse data with a query on a schedule, form a table in Excel? Will this report be sent automatically by mail? Or at least save it on the server, then send it out with a script?
Answer the question
In order to leave comments, you need to log in
Your task can be divided into several separate ones.
1 Oracle has mechanisms for running jobs periodically. dbms_job and dbms_scheduler. The second is able to work on a complex schedule. You can read more in the documentation https://docs.oracle.com/cd/B19306_01/appdev.102/b1... and see usage examples, for example, here citforum.ru/database/oracle/scheduler
2 In order to generate excel -document in Oracle, you can use third-party development. There is a project on GitHub with utility libraries for PL/SQL. You can find it at https://github.com/mortenbra/alexandria-plsql-util...
3 In order to send emails from Oracle, you can use the built-in utl_mail package. Documentationhttps://docs.oracle.com/cd/B19306_01/appdev.102/b1... and usage examples https://oracle-base.com/articles/10g/plsql-enhance...
Actually, in the end it should turn out a task (dbms_scheduler) that collects data on your request, generates an excel document (xlsx_builder_pkg) and sends it as an email attachment (utl_mail or utl_smtp)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question