Thursday, August 21, 2008

Oracle Forms-DEFAULT_VALUE Built-in

DEFAULT_VALUE built-in in oracle forms is used for assign value to variable if value of variable is NULL.
IF :DBT_BRANCH.LOCATION IS NULL THEN
:DBT_BRANCH.LOCATION:='Pune';
END IF;
is equivalent to
default_value('Pune','DBT_BRANCH.LOCATION');
But DEFAULT_VALUE is noramally used to initialize global variable if they are not exist. If global variable are not exist in system then it will create new one or else assign value if its value is NULL.

:SYSTEM.TRIGGER_ITEM vs :SYSTEM.CURRENT_ITEM

Both :SYSTEM.TRIGGER_ITEM and :SYSTEM.CURRENT_ITEM has character string values which is in form of BLOCK_NAME.ITEMN_NAME. :SYSTEM.TRIGGER_ITEM represents the Item in the scope of firing trigger. When :SYSTEM.TRIGGER_ITEM is referenced in KEY-XXX triggers then only it returns the values same as :SYSTEM.CURSOR_ITEM. :SYSTEM.CURSOR_ITEM represents currently focused item and may change in a trigger if navigation takes place. Value of :SYSTEM.TRIGGER_ITEM remains same from begining of trigger till end.