Sunteți pe pagina 1din 2

Page 1 of 2

How to Pass Parameters to a Discoverer Folder [ID 282249.1] Modified 06-JUN-2011 In this Document Goal Solution Type HOWTO Status PUBLISHED

Applies to:
Oracle Discoverer - Version: 4.1.48.08 to 11.1.1.4.0 - Release: 4.1 to 11g Information in this document applies to any platform. ***Checked for relevance on 06-06-2011***

Goal
There will be some circumstances where there is a need to use parameters in Oracle BI Discoverer Administration edition. For example: You are trying to display columns from a nested table datatype using custom folder with the following SQL:
select * from table(select emp_desc from employees where ename={Employee Name})

Where {Employee Name} is the parameter for which users will provide a value when running the workbook. Currently, the Discoverer Administrator does not support parameters in folders. The following steps provide an example of how to workaround this problem.

Solution
Perform the following steps to implement the workaround:

1. Create a database function as follows:


/* This function accepts the parameter passed while running the workbook */ create or replace function setparam (emp_name varchar2) RETURN NUMBER is begin /* Setting the session client information to the value of parameter so that this can be accessed by the custom folder in the admin edition */ dbms_application_info.set_client_info(emp_name); RETURN 1; END;

Rate this document

2. Register this function in the Discoverer Administrator. To register a function, see: Oracle Business Intelligence Discoverer Administration Guide 'How to register custom PL/SQL functions automatically' 3. Create a workbook via Discoverer Plus or Desktop and put a dummy condition in workbook as: 1 = SETPARAM( :{PARAMETER NAME} ) For example: 1= SETPARAM(:Employee Name)

The SETPARAM database function sets the value of parameter passed while running the workbook as client_info for the session and always returns a value of 1. The return value from this fu always returns true . This condition will not have any effect on the data queried by the workbook. The SETPARAM function just serves the purpose of saving the parameter value as client_info which can then be accessed using the function (USERENV('CLIENT_INFO')) set in the folder in The SQL in the custom folder will be:
select * from table(select emp_desc from employees where ename=USERENV('CLIENT_INFO'))

This method indirectly passes the value entered for a parameter in the workbook to the condition in the custom folder.

Related

Products Middleware > Business Intelligence > Discoverer > Oracle Discoverer Keywords ADMINISTRATOR; CUSTOM FOLDER; DISCOVERER ADMINISTRATOR; DISCOVERER PARAMETER; PASSING PARAMETERS

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&... 4/26/2012

Page 2 of 2

Back to top Copyright (c) 2007, 2010, Oracle. All rights reserved. Legal Notices and Terms of Use | Privacy Statement

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&... 4/26/2012

S-ar putea să vă placă și