11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DEFAULT_VALUE built-in<br />

Description<br />

Copies an indicated value to an indicated variable if the variable’s current value is NULL. If the<br />

variable’s current value is not NULL, DEFAULT_VALUE does nothing. Therefore, for text items this<br />

built-in works identically to using the COPY built-in on a NULL item. If the variable is an undefined<br />

global variable, <strong>Form</strong> <strong>Builder</strong> creates the variable.<br />

Syntax<br />

PROCEDURE DEFAULT_VALUE<br />

(value_string VARCHAR2,<br />

variable_name VARCHAR2);<br />

Built-in Type unrestricted procedure<br />

Enter Query Mode yes<br />

Parameters<br />

value_string A valid VARCHAR2 string, variable, or text item containing a valid string.<br />

variable_name A valid variable, global variable, or text item name. The data type of the<br />

variable_name is VARCHAR2. Any object passed as an argument to this<br />

built-in must be enclosed in single quotes.<br />

DEFAULT_VALUE restrictions<br />

The DEFAULT_VALUE built-in is not related to the Initial Value item property.<br />

DEFAULT_VALUE examples<br />

/*<br />

** Built-in: DEFAULT_VALUE<br />

** Example: Make sure a Global variable is defined by<br />

** assigning some value to it with Default_Value<br />

*/<br />

BEGIN<br />

/*<br />

** Default the value of GLOBAL.Command_Indicator if it is<br />

** NULL or does not exist.<br />

*/<br />

Default_Value(’***’,’global.command_indicator’);<br />

/*<br />

** If the global variable equals the string we defaulted<br />

** it to above, then it must have not existed before<br />

*/<br />

IF :Global.Command_Indicator = ’***’ THEN<br />

Message(’You must call this screen from the Main Menu’);<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

END;<br />

75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!