Validating Parameters in Oracle Reports using PL/SQL with Example

Example 1:
----------------------------------------------------------------------------
This trigger aborts the report execution if no rows match the query criteria 
once the user has entered a value for param_sal.
----------------------------------------------------------------------------
function PARAM_SALValidTrigger return boolean is
hold_count number(4);
hold_sal  number(10);
begin
  hold_sal := :param_sal;
  select count(*) into hold_count from emp where sal > hold_sal; 
  if hold_count = 0 then
     srw.message(001,'this report returns no employees');
     raise srw.program_abort;
  end if;
  return(true);
end;

No comments:

Post a Comment

Please Provide your feedback here