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

SET_RELATION_PROPERTY Built-in

Description

Sets the given relation property in a master-detail relationship.

Syntax

SET_RELATION_PROPERTY
(relation_id Relation,
property
NUMBER,
value
NUMBER);

SET_RELATION_PROPERTY
(relation_name VARCHAR2,
property
NUMBER,
value
NUMBER);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

relation_id 
 
Specifies the unique ID that Oracle Forms assigns the relation when it creates the relation object. This can occur automatically when you define a master-detail relationship in Oracle Forms, or you can explicitly create the relation. The data type of the ID is Relation.
 
relation_name 
 
Specifies the name you or Oracle Forms gave the relation object when defining it. The data type of the name is VARCHAR2.
 
property 
 
Use one of the following relation properties, which can be passed to the Built-in as a constant:

AUTO_QUERY Specifies that the detail block of this relation is to be automatically coordinated upon instantiation of the block. This allows potentially expensive processing to be deferred until blocks that are involved in relations are actually visited. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

DEFERRED_COORDINATION Specifies that a block requiring coordination is to be marked but not coordinated until the detail blocks are instantiated. Deferred coordination refers only to the population phase of coordination. Even deferred detail blocks are cleared during the clear phase of coordination to present the form in a visually consistent state. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

MASTER_DELETES (Now called the Delete Record Behavior Property) Specifies the default relation behavior for deletion of a detail record in the detail block when there is a corresponding master record in the master block. Valid values are NON-ISOLATED, ISOLATED, or CASCADING. The ability to set this property programmatically is included only for designers who are coding their own master-detail coordination. It does not alter a default relation that was created at design time.

PREVENT_MASTERLESS_OPERATION Specifies that operations in a detail block are not allowed when no corresponding master record exists. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

value The following constants can be supplied for the properties described earlier:

CASCADING Specifies that the MASTER_DELETES property is to be set so that when an operator deletes a master record, its corresponding detail records are locked at the same time as the master records are locked.

ISOLATED Specifies that the MASTER_DELETES property is to be set so that an operator can delete a master record for which detail records exist. This does not cause subsequent locking and deletion of detail records, however, Oracle Forms still initiates detail block coordination in this case.

NON_ISOLATED Specifies that the MASTER_DELETES property is to be set so that if the operator attempts to delete a master record for which detail records exist, Oracle Forms issues an error message and disallows the deletion.

PROPERTY_TRUE Specifies that the property is to be set to the TRUE state.

PROPERTY_FALSE Specifies that the property is to be set to the FALSE state.

SET_RELATION_PROPERTY Restrictions

You can only set one property per call to this Built-in.

SET_RELATION_PROPERTY Examples

/*

** Built-in: SET_RELATION_PROPERTY
** Example: Set the coordination behavior of a relation to
** be deferred, and auto-query.
*/
PROCEDURE Make_Relation_Deferred( rl_name VARCHAR2 ) IS
rl_id Relation;
BEGIN
/*
** Look for the relation's ID
*/
rl_id := Find_Relation( rl_name );
/*
** Set the two required properties
*/
Set_Relation_Property(rl_id,AUTOQUERY,PROPERTY_TRUE);
END;