A script-enabled browser is required for this page to function properly.

DEFAULT_VALUE Built-in

Description

Copies an indicated value to an indicated variable if the variable's current value is NULL. If the variable's current value is not NULL, DEFAULT_VALUE does nothing. Therefore, for text items this Built-in works identically to using the COPY Built-in on a NULL item. If the variable is an undefined global variable, Oracle Forms creates the variable.

Syntax

PROCEDURE DEFAULT_VALUE
(value_string VARCHAR2,
variable_name
VARCHAR2);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

value_string 
 
A valid VARCHAR2 string, variable, or text item containing a valid string.
 
variable_name 
 
A valid variable, global variable, or text item name. The data type of the variable_name is VARCHAR2. Any object passed as an argument to this Built-in must be enclosed in single quotes.

DEFAULT_VALUE Restrictions

The DEFAULT_VALUE Built-in is not related to the Initial Value item property.

DEFAULT_VALUE Examples

/*

** Built-in: DEFAULT_VALUE
** Example: Make sure a Global variable is defined by
** assigning some value to it with Default_Value
*/
BEGIN
/*
** Default the value of GLOBAL.Command_Indicator if it is
** NULL or does not exist.
*/
Default_Value('***','global.command_indicator');
/*
** If the global variable equals the string we defaulted
** it to above, then it must have not existed before
*/
IF :Global.Command_Indicator = '***' THEN
Message('You must call this screen from the Main Menu');
RAISE Form_Trigger_Failure;
END IF;
END;