Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Oracle Business Intelligence, OLAP and BI training and consulting tips . . .

Click here for more
Oracle News Headlines


Having Discoverer Worksheets Write-Back To The Database
July 23, 2004
Mark Rittman

Looking to have Discoverer write back information to the database whenever a report is run? According to "Discoverer Administrator—How to Perform DML Operations in Discoverer?", the answer is to embed your update, insert or select statement within a function, declare the function as an autonomous transaction, and add that as an item in your worksheet.

Autonomous transactions are 'subtransactions' that can take place independently of any transaction that calls it. Functions that are called from Discoverer normally can't perform any DDL, but if you declare them as autonomous transactions by using the Pragma autonomous_transaction directive they'll get through.

For example, you might have a report that lists out salespeople and their total sales this quarter. You want to log in an audit table the person who ran the report, and what salespeople they displayed in their report. You could then build a function like this:

create or replace function f_report_audit (

                          user varchar2 varchar2(20),

                          salesperson_id varchar2(20),

                          sales_this_quarter number(11,2),

                          when_dt date)

return varchar2


    pragma autonomous_transaction;



    insert into Audit_report







     return null;


You would then register this function within Discoverer Administrator, create an item based on this function and supply the necessary parameters (from the other items in the worksheet, plus the 'User' variable that returns the logged-in userid), then add the item to the report. As the function returns a null, there'll be nothing added to the report, but the key values in the report will now be written to the database alongside the userid and time the report was run.

This note from Tom Kyte explains the background to autonomous transactions, and gives some examples which you could relate back to a function within Discoverer.




Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational