Home » SQL & PL/SQL » SQL & PL/SQL » Using PL/SQL to generate an xls file at specified time intervals
Using PL/SQL to generate an xls file at specified time intervals [message #38713] Wed, 08 May 2002 04:21 Go to next message
Mattias
Messages: 1
Registered: May 2002
Junior Member
I need to generate an xls-file using PL/SQL, and I need to to do this at a specified day and time each month (say the 1st of every month at 1:00 pm). How do I go about this?

Thanks in advance

Regards

Mattias
Re: Using PL/SQL to generate an xls file at specified time intervals [message #38717 is a reply to message #38713] Wed, 08 May 2002 07:06 Go to previous messageGo to next message
motiram
Messages: 21
Registered: January 2001
Junior Member
Write a unix cron process to call a plsql procedure, at the time you want. The procedure should basically read the tables and write into a comma separated text file, which can be read by excel, since it will be a .csv file.
Re: Using PL/SQL to generate an xls file at specified time intervals [message #38722 is a reply to message #38713] Wed, 08 May 2002 10:14 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Instead of using a cron job, although it is a legitimate option, I would recommend using the scheduler built-in to the database: DBMS_JOB

Once you write your procedure, you can schedule it to run as you specified by:

declare
  v_job number;
begin
  dbms_job.submit(v_job, 'procname;', trunc(add_months(trunc(sysdate), 1), 'mm') + (13/24), 'trunc(add_months(trunc(sysdate), 1), ''mm'') + (13/24)');
end;
Re: Using PL/SQL to generate an xls file at specified time intervals [message #38736 is a reply to message #38713] Thu, 09 May 2002 11:17 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Create formatted Excel files with the owa_sylk package. SYLK is Microsoft's Symbolic Link format.
http://asktom.oracle.com/pls/ask/f?p=4950:8:103554::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:728625409049,
Previous Topic: sql query timeout for remote DB
Next Topic: methods to improve the performance of pl/sql stored procedures
Goto Forum:
  


Current Time: Thu Apr 18 04:44:46 CDT 2024