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

SET_RECORD_PROPERTY Built-in

Description

Sets the specified record property to the specified value.

Syntax

SET_RECORD_PROPERTY
(record_number NUMBER,
block_name
VARCHAR2,
property
NUMBER,
value
NUMBER);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

record_number 
 
Specifies the number of the record whose status you want to set. The record number is the record's position in the block. Specify as a whole number.
 
block_name 
 
Specifies the name of the block in which the target record exists. The data type of the name is VARCHAR2.
 
property 
 
Use the following property:
 
STATUS Specifies that you intend to change the record status. STATUS is a constant.
 
value 
 
Use one of the following values:

CHANGED_STATUS Specifies that the record should be marked for update and should be treated as an update when the next commit action occurs.

INSERT_STATUS Specifies that the record is to be marked as an INSERT and should be inserted into the appropriate table when the next commit action occurs.

NEW_STATUS Specifies that the record is to be treated as a NEW record, that is, a record that has not been marked for insert, update, or query. Changed but uncleared or uncommitted records cannot be assigned a status of NEW.

QUERY_STATUS Specifies that the record is to be treated as a QUERY record, whether it actually is. See also the CREATE_QUERIED_RECORD Built-in.

SET_RECORD_PROPERTY Restrictions

The following table illustrates the valid transition states of a record.

Current Status

Target Status

NEW

QUERY

INSERT

CHANGED

NEW

yes

yes1

yes2

no

QUERY

yes4

yes

no

yes

INSERT

yes4

yes3

yes

no

CHANGED

yes4

no

no

yes

  1. Adheres to the rules described in footnotes 2 and 3.
  2. This transition is not allowed in query mode, because QUERY and INSERT are not valid in query mode.
  3. If this transition is performed while Runform is running in Unique Key mode and not all of the transactional triggers exist, then you must enter a valid value in the ROWID field. Put another way, if you are connected to a non-ORACLE data source that does not support ROWID, but you are using a unique key, you must supply the key for a record that goes from Insert to Query, in one of the transactional triggers, either On-Lock, On-Update, or On-Delete. Otherwise Oracle Forms returns an error.
  4. Records that have been changed but not yet committed or cleared cannot be assigned a status of NEW.

SET_RECORD_PROPERTY Examples

/*

** Built-in: SET_RECORD_PROPERTY
** Example: Mark the third record in the EMP block as if it
** were a queried record.
*/
BEGIN
Set_Record_Property( 3, 'EMP', STATUS, QUERY_STATUS);
END;