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

GET_RECORD_PROPERTY Built-in

Description

Returns the value for the given property for the given record number in the given block. The three parameters are required. If you do not pass the proper constants, Oracle Forms issues an error. For example, you must pass a valid record number as the argument to the record_number parameter.

Syntax

FUNCTION GET_RECORD_PROPERTY
(record_number NUMBER,
block_name
VARCHAR2,
property
NUMBER);

Built-in Type unrestricted function

Returns VARCHAR2

Enter Query Mode yes

Parameters

record_number 
 
Specifies the record in a block for which you want property information. The number must correspond to a record number.
 
block_name 
 
Specifies the block containing the target record.
 
property 
 
Specifies the property for which you want the current state. One property constant is supported: STATUS.

STATUS returns NEW if the record is marked as new and there is no changed record in the block. Returns CHANGED if the record is marked as changed. Returns QUERY if the record is marked as query. Returns INSERT if the record is marked as insert.

Usage Notes

The following table illustrates the situations which return a NEW status.

Record Status

Block Status

Form Status

Created record with no modified fields

NEW

<N|Q|C>

<N|Q|C>

...and all records in current block are NEW

NEW

NEW

<N|Q|C>

...and all blocks in current form are NEW

NEW

NEW

NEW

The following table illustrates the effect on record, block, and form status of changes to base table items and control item in base table and control blocks.

Type of Block/Type of Item Changed

Record Status Before Change

Record Status After Change

Block Status

Form Status

In a Base Table Block: Change a Base Table Item

NEW

INSERT

CHANGED

CHANGED

In a Base Table Block:Change a Base Table Item

QUERY

CHANGED

CHANGED

CHANGED

In a Base Table Block:Change a Control Item

QUERY

QUERY

<Q|C>

<Q|C>

...and no record in current block is changed

QUERY

QUERY

<Q|C>

...and no block in current form is changed

QUERY

QUERY

QUERY

In a Base Table Block: Change a Control Item

NEW

INSERT

<Q|C>

<Q|C>

In a Control Block: Change a Control Item

NEW

INSERT

<Q>

<Q|C>

...and no record in current block is changed

INSERT

QUERY

<Q|C>

...and no block in current form is changed

INSERT

QUERY

QUERY

Note:

In general, any assignment to a database item will change a record's status from QUERY to CHANGED (or from NEW to INSERT), even if the value being assigned is the same as the previous value. Passing an item to a procedure as OUT or IN OUT parameter counts as an assignment to it.

Both GET_RECORD_PROPERTY and the system variable SYSTEM.RECORD_STATUS return the status of a record in a given block, and in most cases, they return the same status. However, there are specific cases in which the results may differ.

GET_RECORD_PROPERTY always has a value of NEW, CHANGED, QUERY, or INSERT, because GET_RECORD_PROPERTY returns the status of a specific record without regard to the processing sequence or whether the record is the current record.

SYSTEM.RECORD_STATUS, on the other hand, can in certain cases return a value of NULL, because SYSTEM.RECORD_STATUS is undefined when there is no current record in the system. For example, in a When-Clear-Block trigger, Oracle Forms is at the block level in its processing sequence, so there is no current record to report on, and the value of SYSTEM.RECORD_STATUS is NULL.

GET_RECORD_PROPERTY Examples

/*

** Built-in: GET_RECORD_PROPERTY
** Example: Obtain the status of a record in given block
*/
BEGIN
IF Get_Record_Property(1,'orders',STATUS) = 'NEW' AND
Get_Record_Property(1,'customers',STATUS) = 'NEW' THEN
Message('You must enter a customer and order first!');
RAISE Form_Trigger_Failure;
END IF;
END;