Database Functions
Users and administrators can create requests by directly calling database functions from either Oracle BI Answers, or by using a logical column (in the logical table source) within the metadata repository. Key uses for these functions include the ability to pass through expressions to get advanced calculations, as well as the ability to access custom written functions or procedures on the underlying database.
EVALUATE
This function passes the specified database function with optional referenced columns as parameters to the back-end data source for evaluation. This function is intended for scalar calculations, and is useful when you want to use a specialized database function that is not supported by the Oracle BI Server, but that is understood by the underlying data source.
The embedded database function may require one or more columns. These columns are referenced by %1 ... %N within the function. The actual columns must be listed after the function.
Syntax
EVALUATE('db_function(%1...%N)' [AS data_type] [, column1, columnN])
Where:
db_function
is any valid
database function understood by the underlying data source.
data_type
is an optional parameter that specifies
the data type of the return result. Use this parameter whenever the
return data type cannot be reliably predicted from the input arguments.
However, do not use this parameter for type casting; if the function
needs to return a particular data type, add an explicit cast. You
can typically omit this parameter when the database-specific function
has a return type not supported by the Oracle BI Server, but is used
to generate an intermediate result that does not need to be returned
to the Oracle BI Server.
column1
through columnN
is an optional, comma-delimited list of columns.
Example:
EVALUATE('NLS_INITCAP(%1)' AS VARCHAR(4000),"Requisition
Identification"."Title (BL)")This will capitalize the first letter in every word in the Requisition Title.
EVALUATE_ANALYTIC
This function passes the specified database analytic function with optional referenced columns as parameters to the back-end data source for evaluation.
The embedded database function may require one or more columns. These columns are referenced by %1 ... %N within the function. The actual columns must be listed after the function.
Syntax
EVALUATE_ANALYTIC('db_function(%1...%N)' [AS data_type] [, column1, columnN])
Where:
db_function
is any valid
database analytic function understood by the underlying data source.
data_type
is an optional parameter that specifies
the data type of the return result. Use this parameter whenever the
return data type cannot be reliably predicted from the input arguments.
However, do not use this parameter for type casting; if the function
needs to return a particular data type, add an explicit cast. You
can typically omit this parameter when the database-specific analytic
function has a return type not supported by the Oracle BI Server,
but is used to generate an intermediate result that does not need
to be returned to the Oracle BI Server.
column1
through columnN
is an optional, comma-delimited
list of columns.
Example:
EVALUATE_ANALYTIC ('LEAD(%1,1) OVER (ORDER BY %1)' AS TIMESTAMP,"Submission Dates"."Hired Date")
This will return the next hire according to the Hired Date.
EVALUATE_AGGR
This function passes the specified database function with optional referenced columns as parameters to the back-end data source for evaluation. This function is intended for aggregate functions with a GROUP BY clause.
The embedded database function may require one or more columns. These columns are referenced by %1 ... %N within the function. The actual columns must be listed after the function.
Syntax
EVALUATE_AGGR('db_agg_function(%1...%N)' [AS data_type] [, column1, columnN)
Where:
db_agg_function
is any valid
aggregate database function understood by the underlying data source.
data_type
is an optional parameter that specifies
the data type of the return result. Use this parameter whenever the
return data type cannot be reliably predicted from the input arguments.
However, do not use this parameter for type casting; if the function
needs to return a particular data type, add an explicit cast. You
can typically omit this parameter when the database-specific function
has a return type not supported by the Oracle BI Server, but is used
to generate an intermediate result that does not need to be returned
to the Oracle BI Server.
column1
through columnN
is an optional, comma-delimited list of columns.
Example:
EVALUATE_AGGR('COUNT(DISTINCT CASE WHEN %1 = %2 THEN
%3 END)' AS NUMERIC,"Submission CSW Status - Current"."Current Step
Name","Interview","Submission General Info"."Submission Identifier")This will return the number of submissions currently in the Step of Interview.