Posts

Showing posts with the label PL/SQL

Process and read xlsx from PL/SQL

To read a XLSX-file from PL/SQL can be a bit challenging. One option is to rename the file to .ZIP and then process it from from there. An XLSX-file is actually ZIP archiv es internally. Microsoft Office formats after 2007 (the "Open XML" formats) are structured as a collection of XML files and resources (like images, styles, and document parts) bundled inside a ZIP archive. When you rename file.xlsx → file.zip , you can then: Open it with a ZIP program (like WinRAR, 7-Zip, or even Windows Explorer). Browse its contents — you'll see folders like xl/ , docProps/ , and _rels/ , and files like [Content_Types].xml . Extract parts — e.g., images, embedded objects, raw XML data. But, if you are going to process a single tab document it easier to save the document as CSV and then process it as an external table. How do you then save the XLSX-file as CSV with PL/SQL and read it? Below is instructions on how to do it on Linux. Create a java stored procedure that can ...

DBMS_SCHEDULER

Image
When you back in the day wanted to schedule or run something in the backgound you used DBMS_JOB. With  the beginning of release 10g of the database new functionality was introduced to accomplish this, the DBMS_SCHEDULER. DBMS_SCHEDULER is so much more flexible the DBMS_JOB and makes everything easier, some examples: To set up your intervals you just specify the parameter repeat_interval. MON-FRI 22.00: repeat_interval=> 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=22;' Every hour, every day: repeat_interval => 'FREQ=HOURLY;INTERVAL=1' Every monday, 05:00: repeat_interval=> 'FREQ=DAILY; BYDAY=MON; BYHOUR=5;' You will not get the problem with shifting start times that you have with DBMS_JOB. Possible to create chains of jobs that are dependent of each other. Possible to schedule:   - Execution of host scripts.  - E-mail notifications.  - Execute host scripts on remote servers (requires an agent on the remote server).  - Execute jo...

DBMS_JOB

Submitted/scheduled job can be found in: dba_jobs Running jobs can be found in: dba_jobs_running Remove a job: dbms_job.remove( jobno ); DBMS_JOB have been deprecated and replaced by DBMS_SCHEDULER (available from 10.1). Read more about DBMS_SCHEDULER here .