Oracle Bi Solutions

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 5 March 2013

OBIEE - Executing Stored Procedures/Functions before Reports – Before Report Triggers and Global Temporary Tables

Posted on 06:26 by Unknown

Basically the idea is to execute a stored procedure just before running a report. This stored procedure would basically populate the temporary tables and the report would be rendered based on this data. In our case, we shall start with a simple example. We will be creating a Global Temporary table(GTT) which would be an exact copy of the EMP table of scott schema. We shall be creating a function to load the data from the EMP table to this GTT. And this GTT can retain the data for the session using PRESERVE ROWS clause. So, lets first start with a GTT as shown below
CREATE GLOBAL TEMPORARY TABLE EMP_GTT
(
EMPNO NUMBER,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2)
)
ON COMMIT PRESERVE ROWS
As you see above, it has the same columns structure as the EMP table. Now lets create a simple function which will insert data from the EMP table to the above GTT table(remember this has no error handling, this is primarily for test purposes).
CREATE OR REPLACE FUNCTION LOAD_GTT RETURN VARCHAR2 IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO EMP_GTT(
EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO
)
(
SELECT
EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO
FROM EMP);
COMMIT;
RETURN ‘TRUE’;
END;
      
The PRAGMA AUTONOMOUS_TRANSACTION allows us to do DML operations within the function. Once this is done, go to BI EE Administration tool and import this GTT table. Also design the BM and Presentation Layer.
      
Now, double click on the Connection Pool and go to the Connection Scripts tab. In the Connection Scripts tab -> Execute before query, enter the below query
select load_gtt() from dual
      
Now, save this and go to the Answers and create a simple report. You would notice that the GTT would now have data since the function is executed first and then the report is rendered.
      
Also, if you check the logs, you would notice that the select statement that we included in the connection scripts tab would also have been fired. Do not worry about the order of appearance of the select statement in the logs. If you have any existing stored procedures then just create a function and call that procedure from this function.
      
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in OBIEE | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Upper Function
    In Oracle/PLSQL, the  upper function  converts all letters in the specified string to uppercase. If there are characters in the string that ...
  • OBIEE 11g Hide/Show Sections based on Dashboard Prompt
    allow a user’s interaction to hide/show certain sections of a dashboard. In this particular case the user wanted to choose either ‘Quarterly...
  • [OBIEE11g] - OBIEE Dashboard for Informatica Metadata Reporting
    The metadata that Informatica Power Center 8 retains in its repository can be exposed via OBIEE reports and dashboards. This metadata includ...
  • [ODI] - Frequently Asked Questions (FAQ)
    Here is a list of FAQs about Oracle Data Integrator 1) What is Oracle Data Integrator (ODI)? 2) What is E-LT? 3) What components make up Ora...
  • OBIEE 11g not showing new dashboard in the drop down menu
    When creating New dashboard in  OBIEE 11g, I have faced with issue that dashboard name did not show up in drop down dashboard menu. 1. When ...
  • Data Modeling: Schema Generation Issue with ERwin Data Modeler 7.3
    We are using Computer Associate’s ERwin Data Modeler 7.3 for data modeling. In one of our engagements, we are pushing data model changes to ...
  • Installation Informatica Powercenter 9.1 on Oracle Enterprise Linux 5.6
    Ingredients: Program Version Filename Oracle Express 11G 11.2.0 oracle-xe-11.2.0-0.5.x86_64.rpm SQL Developer 3.0 sqldeveloper-3.0.04.34-1.n...
  • Informatica Powercenter Workflow Manager Repository Navigator docking float issue
    In case you’re also experiencing where your Repository Navigator is not dock or attached and it seems just floating within Workflow Manager ...
  • [OBIEE11g] - Creating Dashboard Traversing Through Graph
    The general requirement asked for by customers is that they want to Click on the Main Dashboard Page’s Graph and be transferred to the other...
  • OBIEE 11g - Query Limit
    Query limit and number of minutes a query can run per physical layer database connection, follow the below steps. > Login to Repository u...

Categories

  • BI Publisher
  • DAC
  • DataWarehouse
  • Hyperion
  • Informatica
  • OBIEE
  • ODI
  • Oracle Applications EBS 12.1.3
  • Oracle Database
  • PL/SQL
  • SQL
  • Unix/Linux

Blog Archive

  • ▼  2013 (500)
    • ►  November (8)
    • ►  October (1)
    • ►  July (4)
    • ►  June (9)
    • ►  May (15)
    • ►  April (24)
    • ▼  March (43)
      • EBS 12.1.3
      • OBIEE 11g - Weblogic Security Administration
      • Error: OBIEE 11g: Error: "Stream Closed" Server Ex...
      • OBIEE 11g - Oracle Map viewer Installation & Confi...
      • Hyperion - Essbase Production Server crash
      • Hyperion - EPM, Fusion Edition Performance and Tun...
      • Hyperion FAQ'S
      • Hyperion Planning 11.1.2.2 Calculation Manager Is...
      • OBIEE 11g - Hyperion Integration With OBIEE
      • OBIEE 11g - Single Sign On With (EBS)
      • Hyperion Financial Reports – Preview User Point of...
      • OBIEE 11g - Display user name and time of the repo...
      • OBIEE 11g - Getting the custom links on the OBIEE ...
      • OBIEE 11g - supports 2 kinds of clustering Vertica...
      • DAC - Replace Base: Procedure for Upgrading
      • DAC - Simplified Refresh From Base Option
      • DAC - Peer to Peer Merge
      • OBIEE 11g - User Specific UI
      • OBIEE 11g - Multiple values in single column using...
      • OBIEE 11g - Look up Tables in obiee11g
      • DAC - W_DAY_D and Configure the Multi Calendar su...
      • OBIEE 11g - Roll back Selection Security to be Enable
      • OBIEE 11g - XMLP Server Cache Control
      • OBIEE 11g - How to remotely connect to online RPD
      • BI Publisher - 10g to 11g Upgrade Process
      • OBIEE 11g - Deployment of BI Publisher reports
      • OBIEE 11g - Deinstall
      • OBIEE 11g - Uploading/calling PDF file into OBIEE ...
      • OBIEE 11g - Switching Between Multiple Reports
      • OBIEE 11g - Action link saving a report in local d...
      • OBIEE 11g - Disable Caching
      • OBIEE - Executing Stored Procedures/Functions befo...
      • How to call stored procedure from DAC?
      • OBIEE - Selecting a Single Value and Showing a Range
      • OBIEE - Handy Date Session Variables
      • OBIEE 11g - Calculated % always shows up as 0%
      • OBIEE 11g - Using a Dashboard Prompt as a Column S...
      • OBIEE 11g - How to get proper date sorting in graphs
      • OBIEE 11g - Sorting on the Total in a Pivot
      • OBIEE - Google Charts
      • OBIEE11g - Inline Microcharts using Google Charts API
      • OBIEE 11g - Dashboard Background Image or Watermark
      • NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A gen...
    • ►  February (73)
    • ►  January (323)
Powered by Blogger.

About Me

Unknown
View my complete profile