Printing Get Record Property Built-In

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

GET_RECORD_PROPERTY built-in

Examples 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, Form Builder 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 block_name property Specifies the record in a block for which you want property information. The number must correspond to a record number. Specifies the block containing the target record. 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. Related Topics All Built-ins

Record Status Created record with no modified fields ...and all records in current block are NEW ...and all blocks in current form are NEW NEW NEW NEW

Block Status <N|Q|C> NEW NEW

Form Status <N|Q|C> <N|Q|C> 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 In a Base Table Block: Change a Base Table Item In a Base Table Block:Change a Base Table Item

Record Status Before Change NEW

Record Status After Change INSERT

Block Status

Form Status

CHANGED

CHANGED

QUERY

CHANGED

CHANGED

CHANGED

In a Base Table Block:Change a Control Item ...and no record in current block is changed ...and no block in current form is changed

QUERY

QUERY

<Q|C>

<Q|C>

QUERY

QUERY

<Q|C>

QUERY

QUERY

QUERY

In a Base Table Block: Change a Control Item In a Control Block: Change a Control Item ...and no record in current block is changed ...and no block in current form is changed Note:

NEW

INSERT

<Q|C>

<Q|C>

NEW

INSERT

<Q>

<Q|C>

INSERT

QUERY

<Q|C>

INSERT

QUERY

QUERY

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, Form Builder 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.

You might also like