A script-enabled browser is required for this page to function properly.

SRW.SET_MAXROW built-in procedure

This procedure sets the maximum number of records to be fetched for the specified query. This is useful when your report formats (that is, displays) fewer records than the query (or queries) that fetch them. Thus, with SRW.SET_MAXROW, you can conditionally restrict data that is fetched for your report, enabling you to improve the report's performance.

Syntax

SRW.SET_MAXROW (query_name CHAR, maxnum PLS_INTEGER);

Parameters

Description

query_name

Is the query whose fetched records will be limited. 

maxnum

Is maximum number of records you want the query to fetch.

Restrictions

GUI access

You can also define the maxnum parameter using the Reports Builder user interface:

Property Inspector

Set the Maximum Rows to Fetch property.

Example

Suppose your report has two queries, Q_Stocks and Q_Bonds. Suppose also, that you have a user-created parameter, named WHICHDATA, that enables users to specify which data they want the report to display: either stocks or bonds. In the Before Report trigger, you could use the SRW.SET_MAXROW procedure to ensure that only one query's data is fetched:

FUNCTION FETCHIT RETURN BOOLEAN IS 
BEGIN 
  if :whichdata != 1 then 
    srw.set_maxrow ('Q_Stocks', 0); 
  else 
    srw.set_maxrow ('Q_Bonds', 0); 
  end if;
  RETURN (TRUE); 
END; 

See also

About the Reports Builder built-in package (SRW)

SRW built-in package