SRW.SET_FIELD
built-in procedureThis procedure sets the value of a character, number, or date field. This is useful when you want to conditionally change a field's value.
SRW.SET_FIELD (object_id, text CHAR | number NUM | date DATE);
Parameters |
Description |
|
Is always 0. (The object must always set its own attributes.) |
|
Is the character, number, or date string you want the field to display. |
TO_DATE
function. For example:
srw.set_field(0, to_date('01-JAN-99'));
srw.set_field(0, 99);
Alternatively, you can use the quotes if you also use the TO_NUMBER
function. For example:
srw.set_field(0, to_number('99'));
TO_CHAR
function for consistency
with number and date values:
srw.set_field(0, to_char('my string'));
SRW.SET_FIELD
should be used only to change the contents of
a field's datatype, not change the field to a different datatype.
Suppose you want to conditionally change the number of a field, based on each employee's salary. In the format trigger for the field, you could type the following:
FUNCTION CHGFIELD RETURN BOOLEAN IS
TMP NUMBER;
BEGIN
if :sal >= 2000 then
tmp := :sal * 1.08;
srw.set_field (0, tmp);
else
srw.set_field (0, 2500);
end if;
RETURN (TRUE);
END;
About the
Reports Builder built-in package (SRW
)
Copyright © 1984, 2005, Oracle. All rights reserved.