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

SET_BLOCK_PROPERTY Built-in

Description

Sets the given block characteristic of the given block.

Syntax

SET_BLOCK_PROPERTY
(block_id Block,
property 
NUMBER,
value 
VARCHAR);

SET_BLOCK_PROPERTY
(block_id Block,
property 
NUMBER,
NUMBER);

SET_BLOCK_PROPERTY
(block_id Block,
property
NUMBER,

NUMBER
NUMBER);

SET_BLOCK_PROPERTY
(block_name VARCHAR2,
property 
NUMBER,
value 
VARCHAR);

SET_BLOCK_PROPERTY
(block_name VARCHAR2,
property 
NUMBER,
NUMBER);

SET_BLOCK_PROPERTY
(block_name VARCHAR2,
property 
NUMBER,
NUMBER,
NUMBER);

SET_BLOCK_PROPERTY
(block_name,
property
,
value );

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

block_id 
 
The unique ID Oracle Forms assigned to the block when you created it. Datatype is BLOCK.
 
block_name 
 
The name you gave the block when you created it. Datatype is VARCHAR2.
 
property 
 
Specify one of the following constants:
 

BLOCKSCROLLBAR_POSITION Specifies both the x and y positions of the block's scroll bar in the form coordinate units indicated by the Coordinate System form property. For example, in a WHEN-NEW-BLOCK-INSTANCE trigger, the following code

set_block_property('emp', blockscrollbar_position, 30, 10);

positions the scrollbar to x and y-axis coordinates of 30 and 10 when you enter in that block.

BLOCKSCROLLBAR_X_POS Specifies the x position of the block's scroll bar in the form coordinate units indicated by the Coordinate System form property. For example, in a WHEN-NEW-BLOCK-INSTANCE trigger, the following code

set_block_property('emp', blockscrollbar_x_pos, 10);

positions the scrollbar's x-axis coordinate to 10.

BLOCKSCROLLBAR_Y_POS Specifies the y position of the block scroll bar in the form coordinate units indicated by the Coordinate System form property. For example, in a in a WHEN-NEW-BLOCK-INSTANCE trigger, the following code

set_block_property('emp', blockscrollbar_y_pos, 45);

positions the scrollbar's y-axis coordinator to 45.

COORDINATION_STATUS Specifies a status that indicates whether a block that is a detail block in a master-detail relation is currently coordinated with all of its master blocks; that is, whether the detail records in the block correspond correctly to the current master record in the master block. Valid values are COORDINATED and NON_COORDINATED

CURRENT_RECORD_ATTRIBUTE Specify the VARCHAR2 name of a named visual attribute to be associated with the given block. If the named visual attribute does not exist, you will get an error message.

CURRENT_ROW_BACKGROUND_COLOR The color of the object's background region.

CURRENT_ROW_FILL_PATTERN The pattern to be used for the object's fill region. Patterns are rendered in the two colors specified by Background Color and Foreground Color.

CURRENT_ROW_FONT_NAME The font family, or typeface, that should be used for text in the object. The list of fonts available is system-dependent.

CURRENT_ROW_FONT_SIZE The size of the font, specified in points.

CURRENT_ROW_FONT_SPACING The width of the font, that is, the amount of space between characters (kerning).

CURRENT_ROW_FONT_STYLE The style of the font.

CURRENT_ROW_FONT_WEIGHT The weight of the font.

CURRENT_ROW_FOREGROUND_COLOR The color of the object's foreground region. For items, the Foreground Color attribute defines the color of text displayed in the item.

DEFAULT_WHERE sets the WHERE clause on the block and OVERRIDES the value set at design time.

The WHERE reserved word is optional. The default WHERE clause can include references to global variables, form parameters, system parameters, and item values, specified with standard bind variable syntax.

DELETE_ALLOWED Specifies whether the operator or the application is allowed to delete records in the given block. Valid values are PROPERTY_TRUE or PROPERTY_FALSE.

DML_DATA_TARGET_NAME Specifies the name of the block's DML data source.

ENFORCE_PRIMARY_KEY Specifies that any record inserted or updated in the block must have a unique characteristic in order to be committed to the database. Valid values are PROPERTY_TRUE or PROPERTY_FALSE.

INSERT_ALLOWED Specifies whether the operator or the application is allowed to insert records in the given block. Valid values are PROPERTY_TRUE or PROPERTY_FALSE.

KEY_MODE Specifies the key mode for the block. This is particularly useful when running Oracle Forms against non-ORACLE data sources. Valid values are UPDATEABLE_PRIMARY_KEY and NON_UPDATEABLE_PRIMARY_KEY.

LOCKING_MODE Specifies the block's LOCKING_MODE property. Valid values are DELAYED or IMMEDIATE.

MAX_RECORDS_FETCHED Specifies the maximum number of records that can be fetched. This property is only useful when the Query All Records property is set to Yes.

NAVIGATION_STYLE Specifies the block's NAVIGATION_STYLE property. Valid values are SAME_RECORD, CHANGE_RECORD, or CHANGE_BLOCK.

NEXT_NAVIGATION_BLOCK Specifies the name of the block's next navigation block. By default, the next navigation block is the block with the next higher sequence number; however, the NEXT_NAVIGATION_BLOCK block property can be set to override the default block navigation sequence.

ONETIME_WHERE Specifies a one time where clause for the block, overriding any previous ONETIME_WHERE clause. The ONETIME_WHERE clause can include references to global variables, forms parameters, and item values, specified with standard bind variable syntax.

OPTIMIZER_HINT Specifies a hint that Oracle Forms passes on to the RDBMS optimizer when constructing queries. This allows the form designer to achieve the highest possible performance when querying blocks.

ORDER_BY Specifies a default ORDER BY clause for the block, overriding any prior ORDER BY clause. Do not include the actual words 'ORDER BY'. Oracle Forms automatically prefixes the statement you supply with "ORDER BY."

PRECOMPUTE_SUMMARIES Specifies that the value of any summarized item in a data block is computed before the normal query is issued on the block. Oracle Forms issues a special query that selects all records (in the database) of the summarized item and performs the summary operation (sum, count, etc.) over all the records.

PREVIOUS_NAVIGATION_BLOCK Specifies the name of the block's previous navigation block. By default, the previous navigation block is the block with the next lower sequence number; however, the NEXT_NAVIGATION_BLOCK block property can be set to override the default block navigation sequence.

QUERY_ALLOWED Specifies whether a query can be issued from the block, either by an operator or programmatically. Valid values are PROPERTY_TRUE or PROPERTY_FALSE.

QUERY_DATA_SOURCE_NAME Specifies the name of the block's query data source. Note: You cannot set a blocks’ QUERY_DATA_SOURCE_NAME when the block’s datasource is a procedure.

QUERY_HITS Specifies the NUMBER value that indicates the number of records identified by the COUNT_QUERY operation.

UPDATE_ALLOWED Specifies whether the operator or the application is allowed to update records in the given block. Valid values are PROPERTY_TRUE or PROPERTY_FALSE.

UPDATE_CHANGED_COLUMNS Specifies that only those columns updated by an operator will be sent to the database. When Update Changed Columns Only is set to No, all columns are sent, regardless of whether they have been updated. This can result in considerable network traffic, particularly if the block contains a LONG data type.

value The following constants can be passed as arguments to the property values described earlier:

COORDINATED Specifies that the COORDINATION_STATUS property should be set to COORDINATED for a block that is a detail block in a master-detail relation.

DELAYED Specifies that you want Oracle Forms to lock detail records only at the execution of a commit action.

IMMEDIATE Specifies that you want Oracle Forms to lock detail records immediately whenever a database record has been modified.

NON_COORDINATED Specifies that the COORDINATION_STATUS property should be set to NON_COORDINATED for a block that is a detail block in a master-detail relation.

NON_UPDATEABLE_PRIMARY_KEY Specifies that you want Oracle Forms to process records in the block on the basis that the underlying data source does not allow primary keys to be updated.

PROPERTY_TRUE Specifies that the property is to be set to the TRUE state. Specifically, supply as the value for DELETE_ALLOWED, INSERT_ALLOWED, QUERY_HITS, and UPDATE_ALLOWED.

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

UNIQUE_KEY Specifies that you want Oracle Forms to process records in the block on the basis that the underlying data source uses some form of unique key, or ROWID.

UPDATEABLE_PRIMARY_KEY Specifies that you want Oracle Forms to process records in the block on the basis that the underlying data source allows for primary keys to be updated.

x 
 
The NUMBER value of the axis coordinate specified in form coordinate system units. If setting both x and y positions this value refers to the x coordinate. When setting the y position only, this value refers to the y coordinate.
 
y 
The NUMBER value of the y axis coordinate specified in form coordinate system units. This value applies when setting both x and y positions, and can be ignored for all other properties.

SET_BLOCK_PROPERTY Examples

/*

** Built-in: SET_BLOCK_PROPERTY
** Example: Prevent future inserts, updates, and deletes to
** queried records in the block whose name is
** passed as an argument to this procedure.
*/
PROCEDURE Make_Block_Query_Only( blk_name IN VARCHAR2 )
IS
blk_id Block;
BEGIN
/* Lookup the block's internal ID */
blk_id := Find_Block(blk_name);
/*
** If the block exists (ie the ID is Not NULL) then set
** the three properties for this block. Otherwise signal
** an error.
*/
IF NOT Id_Null(blk_id) THEN
Set_Block_Property(blk_id,INSERT_ALLOWED,PROPERTY_FALSE);
Set_Block_Property(blk_id,UPDATE_ALLOWED,PROPERTY_FALSE);
Set_Block_Property(blk_id,DELETE_ALLOWED,PROPERTY_FALSE);
ELSE
Message('Block '||blk_name||' does not exist.');
RAISE Form_Trigger_Failure;
END IF;
END;

Using BLOCKSCROLLBAR_POSITION:

/*

** Built-in: SET_BLOCK_PROPERTY
** Example: Set the x and y position of the block's scrollbar
**  to the passed x and y coordinates

*/
PROCEDURE Set_Scrollbar_Pos( blk_name IN VARCHAR2, xpos IN
NUMBER, ypos IN NUMBER )
IS
BEGIN
Set_Block_Property(blk_name, BLOCKSCROLLBAR_POSITION, xpos, ypos);

END;


GET_BLOCK_PROPERTY Built-in