Generating PDF in oracle and emailing it

Posted on 2012-08-31
Last Modified: 2012-09-03
Hello everybody,

At the moment in our firm we use Oracle db 10.2 version running on linux server.

Now we have a task upon us and that is we have to generate a report every day at exact same time and send it via email (prefer the pdf file format).

Generally we use Oracle reports version 6i to that (yes i know old technology but cant do much about that right now).

Any ideas or working examples os some procedure that can do that are more than welcome.

Thank you for reading!
Question by:Caruso_eu
    LVL 5

    Expert Comment

    by:Sanjeev Labh
    You can create a the report with the format preset to PDF. On your reports server you can submit a cron job and call a shell script. Through the shell script invoke this report and save it on a destination directory. From the shell script only you can send it as a mail to whoever concerned.

    Author Comment

    You are saying report server ... we do not have a report server. Oracle reports version 6 does not have server as far as i know.
    LVL 22

    Expert Comment

    by:Helena Marková
    Oracle Forms 6i/Reports 6i is the last client/server version but it is also the first web version. There are forms server and also report server there (I am not sure but it was Apache).
    LVL 73

    Accepted Solution

    try the Anton Scheffer's package for creating pdf files and my own package for sending them

    small example...

        v_pdf     BLOB;
        v_message CLOB := 'messge text';

            'This is rotated text',

            'select view_name, text_length, read_only from all_views where owner = ''SYS'' and rownum <= 20'

        v_pdf := as_pdf3.get_pdf;

            p_sender          => :p_from,
            p_recipients      => :p_to,
            p_subject         => 'Test msg',
            p_message         => v_message,
            p_attachment      => v_pdf,
            p_att_inline      => FALSE,
            p_att_mime_type   => 'application/pdf',
            p_att_filename    => 'test.pdf'

    Author Comment

    Thank you!

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    Suggested Solutions

    Article by: Swadhin
    From the Oracle SQL Reference ( we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now