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

Before Parameter Form trigger

The Before Parameter Form trigger fires before the Runtime Parameter Form is displayed. From this trigger, you can access and change the values of parameters, PL/SQL global variables, and report-level columns. If the Runtime Parameter Form is suppressed, this trigger still fires. Consequently, you can use this trigger for validation of command line parameters.

Definition Level

Report

On Failure

Displays an error message and then returns to the place from which you ran the report. 

Usage Notes

If the Parameter Form is used on the Web, the Before Parameter Form trigger fires twice: once when the Parameter Form is displayed, and a second time when the parameters are submitted. This is because Reports Builder executes in a stateless fashion. There is no session to return to, so the Before Parameter Form trigger has to fire the second time to ensure that the parameters selected on the Parameter Form and passed on the command line are valid.

If you test to see if the parameter is null before setting it in your Before Parameter Form trigger, it will accept any user entered/modified values. If untouched, it will be set with the value defined in the trigger. This needs to be done for all parameter values that are set in the trigger, not just for dates. For example, using a parameter named :p_date_from you can test the value in the Before trigger:

IF :p_date_from IS NULL THEN 
  :p_date_from := TRUNC(sysdate-1) ; 
END IF ; 

See also

About triggers

About report triggers

Creating a report trigger

Deleting a report trigger

About DML and DDL