P. 1
Reports Reference

Reports Reference

|Views: 850|Likes:
Published by Hemanth Pidaparthi

More info:

Published by: Hemanth Pidaparthi on Sep 16, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/07/2012

pdf

text

original

Description This procedure sets the value of a character, number, or date field. This is useful when you
want to conditionally change a field’s value.

Syntax

SRW.SET_FIELD (object_id, text CHAR|number NUM|date DATE);

Parameters

object_id

Is always 0. (The object must always set its
own attributes.)

text
number
date

Is the character, number, or date string you
want the field to display.

Usage Notes

n

For date values, you need to convert the second argument to a date value with the
TO_DATE function. For example:

srw.set_field(0, to_date(’01-JAN-99’));

n

If you omit quotes around the value, the value is assumed to be a number. For example:

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’));

n

If you use quotes without a function, the value is assumed to be a character string.
Alternatively, you can use the TO_CHAR function for consistency with number and date
values:

srw.set_field(0, to_char(’my string’));

SRW.SET_FIELD Example

/* 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;

Report Builder Reference

65

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->