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.

SYSTEM.RECORD_STATUS system variable<br />

Syntax<br />

SYSTEM.RECORD_STATUS<br />

Description<br />

SYSTEM.RECORD_STATUS represents the status of the record where the cursor is located. The value<br />

can be one of four character strings:<br />

Usage Notes<br />

CHANGED Indicates that a queried record’s validation status is Changed.<br />

INSERT Indicates that the record’s validation status is Changed and that the<br />

record does not exist in the database.<br />

NEW Indicates that the record’s validation status is New.<br />

QUERY Indicates that the record’s validation status is Valid and that it was<br />

retrieved from the database.<br />

Both SYSTEM.RECORD_STATUS and the GET_RECORD_PROPERTY built-in return the status of a<br />

record in a given block, and in most cases, they return the same status. However, there are specific cases<br />

in which the results may differ.<br />

SYSTEM.RECORD_STATUS can in certain cases return a value of NULL, because<br />

SYSTEM.RECORD_STATUS is undefined when there is no current record in the system. For example,<br />

in a When-Clear-Block trigger, <strong>Form</strong> <strong>Builder</strong> is at the block level in its processing sequence, so there is<br />

no current record to report on, and the value of SYSTEM.RECORD_STATUS is NULL.<br />

GET_RECORD_PROPERTY, on the other hand, always has a value of NEW, CHANGED, QUERY, or<br />

INSERT, because it returns the status of a specific record without regard to the processing sequence or<br />

whether the record is the current record.<br />

SYSTEM.RECORD_STATUS examples<br />

Assume that you want to create a trigger that performs a commit before clearing a Changed record. The<br />

following Key-CLRREC trigger performs this function.<br />

IF :System.Record_Status IN (’CHANGED’, ’INSERT’) THEN<br />

Commit_<strong>Form</strong>;<br />

END IF;<br />

Clear_Record;<br />

409

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

Saved successfully!

Ooh no, something went wrong!