Infolinks

Saturday, 21 July 2012

srw-reference

Description  This procedure causes Report Builder to add the referenced object to the PL/SQL construct’s dependency list.  This causes Report Builder to determine the object’s value just before firing the PL/SQL construct.  This is useful when you want to ensure that a column value
passed to a user exit is the most recently computed or fetched value.
Syntax           SRW.REFERENCE (:object CHAR|DATE|NUMBER);
Parameters
object Is the Report Builder parameter or column whose value needs to be ascertained before the
construct fires.
Restrictions
The colon is required before the object name.
SRW.REFERENCE is unnecessary when the object is already referenced in the current PL/SQL construct.
Example
/* Suppose you want to pass the temperature and pressure values ** to a user exit called SUPERHEAT.  Suppose, also, that if the ** temperature is too low, you want to raise a customized error message.  ** To do so, you could write the following formula:*/
FUNCTION EXIT RETURN BOOLEAN IS
BEGIN
  if :temp > 0 then
     srw.reference (:temp); — unnecessary reference
     srw.reference (:pressure);
     srw.user_exit(‘superheat temp pressure’);
  else srw.message(1000, ‘Temperature is below
     normal. Is machine off?’);
     raise srw.program_abort;
  end if;
RETURN(TRUE);
END;

No comments:

Post a Comment