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

GET_BLOCK_PROPERTY Built-in

Description

Returns information about a specified block. You must issue a call to the Built-in once for each property value you want to retrieve.

Syntax

FUNCTION GET_BLOCK_PROPERTY
(block_id Block,
property NUMBER);

FUNCTION GET_BLOCK_PROPERTY
(block_name VARCHAR2,
property
NUMBER);

Built-in Type unrestricted function

Returns VARCHAR2

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 to return information about the given block:

ALL_RECORDS Specifies whether all the records matching the query criteria should be fetched into the data block when a query is executed at runtime.

BLOCKSCROLLBAR_X_POS Returns the x position of the block's scroll bar as a number specified in the form coordinate units indicated by the Coordinate System form property.

BLOCKSCROLLBAR_Y_POS Returns the y position of the block's scroll bar as a number specified in the form coordinate units indicated by the Coordinate System form property.

COLUMN_SECURITY Returns the VARCHAR2 value of TRUE if column security is set to Yes, and the VARCHAR2 string FALSE if it is set to No.

COORDINATION_STATUS For a block that is a detail block in a master-detail block relation, this property specifies the coordination status of the block with respect to its master block(s). Returns the VARCHAR2 value COORDINATED if the block is coordinated with all of its master blocks. If it is not coordinated with all of its master blocks, the Built-in returns the VARCHAR2 value NON_COORDINATED. Immediately after records are fetched to the detail block, the status of the detail block is COORDINATED. When a different record becomes the current record in the master block, the status of the detail block again becomes NON_COORDINATED.

CURRENT_RECORD Returns the number of the current record.

CURRENT_RECORD_ATTRIBUTE Returns the VARCHAR2 name of the named visual attribute of the given block.

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 Returns the default WHERE clause in effect for the block, as indicated by the current setting of the WHERE block property.

DELETE_ALLOWED Returns the VARCHAR2 value TRUE if the Delete Allowed block property is Yes, FALSE if it is No. This property determines whether the operator or the application is allowed to delete records in the block.

DML_DATA_TARGET_NAME Returns the VARCHAR2 name of the block's DML data source.

DML_DATA_TARGET_TYPE Returns the VARCHAR2 value that indicates the current setting of the DML Data Target Type property. Return values for this property are NONE, TABLE, STORED PROCEDURE, or TRANSACTIONAL TRIGGER.

ENFORCE_PRIMARY_KEY Returns the VARCHAR2 value TRUE if the Enforce Primary Key property is set to Yes for the block. Otherwise, if the Enforce Primary Key property is set to No, this parameter returns the VARCHAR2 value FALSE.

ENTERABLE Returns the VARCHAR2 value TRUE if the block is enterable, that is, if any item in the block has its Enabled and Keyboard Navigable properties set to Yes. Returns the VARCHAR2 string FALSE if the block is not enterable.

FIRST_DETAIL_RELATION Returns the VARCHAR2 name of the first relation in which the given block is a detail. Returns NULL if one does not exist.

FIRST_ITEM Returns the VARCHAR2 name of the first item in the given block.

FIRST_MASTER_RELATION Returns the VARCHAR2 name of the first relation in which the given block is a master. Returns NULL if one does not exist.

INSERT_ALLOWED Returns the VARCHAR2 value TRUE if the Insert Allowed block property is Yes, FALSE if it is No. This property determines whether the operator or the application is allowed to insert records in the block.

KEY_MODE Returns the VARCHAR2 value that indicates the current setting of the Key Mode block property. Return values for this property are UNIQUE_KEY, UPDATEABLE_PRIMARY_KEY, or NON_UPDATEABLE_PRIMARY_KEY.

LAST_ITEM Returns the name of the last item in the given block.

LAST_QUERY Returns the SQL statement of the last query in the specified block.

LOCKING_MODE Returns the VARCHAR2 value IMMEDIATE if rows are to be locked immediately on a change to a base table item; otherwise, it returns the VARCHAR2 value DELAYED if row locks are to be attempted just prior to a commit.

MAX_QUERY_TIME Returns the VARCHAR2 value that indicates the current setting of the Maximum Query Time property. This property determines whether the operator can abort a query when the elapsed time of the query exceeds the value of this property.

MAX_RECORDS_FETCHED Returns a number representing 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 Returns the VARCHAR2 value that indicates the current setting of the block's NAVIGATION_STYLE property, either SAME_RECORD, CHANGE_RECORD, or CHANGE_BLOCK.

NEXTBLOCK Returns the name of the next block. Returns NULL if the indicated block is the last block in the form. Note that the setting of the block's NEXT_NAVIGATION_BLOCK property has no effect on the value of NEXTBLOCK.

NEXT_NAVIGATION_BLOCK Returns the VARCHAR2 name of the block's next navigation block. By default, the next navigation block is the next block as defined by the order of blocks in the Object Navigator; however, the NEXT_NAVIGATION_BLOCK block property can be set to override the default block navigation sequence.

ONETIME_WHERE Returns the current one time where clause in effect for the specified block. It returns a NULL string if ONETIME_WHERE clause was not set before the query was executed.

OPTIMIZER_HINT Returns a hint in the form of a VARCHAR2 string that Oracle Forms passes on to the RDBMS optimizer when constructing queries.

ORDER_BY Returns the default ORDER BY clause in effect for the block, as indicated by the current setting of the ORDER BY block property.

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.

PREVIOUSBLOCK Returns the name of the block that has the next lower sequence in the form, as defined by the order of blocks in the Object Navigator. Returns NULL if the indicated block is the first block in the form. Note that the setting of the block's PREVIOUS_NAVIGATION_BLOCK property has no effect on the value of PREVIOUSBLOCK.

PREVIOUS_NAVIGATION_BLOCK Returns the VARCHAR2 name of the block's previous navigation block. By default, the previous navigation block is the block with the next lower sequence, as defined by the order of blocks in the Object Navigator; however, the NEXT_NAVIGATION_BLOCK block property can be set to override the default block navigation sequence.

QUERY_ALLOWED Returns the VARCHAR2 value TRUE if the Query Allowed block property is Yes, FALSE if it is No. This property determines whether the operator or the application is allowed to query records in the block.

QUERY_DATA_SOURCE_NAME Returns the VARCHAR2 name of the block's query data source.

QUERY_DATA_SOURCE_TYPE Returns the VARCHAR2 value that indicates the current setting of the Query Data Source Type property. Return values for this property are NONE, TABLE, STORED PROCEDURE, TRANSACTIONAL TRIGGER, or SUB-QUERY.

QUERY_HITS Returns the VARCHAR2 value that indicates the number of records identified by the COUNT_QUERY operation. If this value is examined while records are being retrieved from a query, QUERY_HITS specifies the number of records that have been retrieved.

QUERY_OPTIONS Returns the VARCHAR2 values VIEW, FOR_UPDATE, COUNT_QUERY, or a null value if there are no options. You can call GET_BLOCK_PROPERTY with this parameter from within a transactional trigger when your user exit needs to know what type of query operation Oracle Forms would be doing by default if you had not circumvented default processing.

RECORDS_DISPLAYED Returns the number of records that the given block can display. Corresponds to the Number of Records Displayed block property.

RECORDS_TO_FETCH Returns the number of records Oracle Forms expects an On-Fetch trigger to fetch and create as queried records.

STATUS Returns the VARCHAR2 value NEW if the block contains only new records, CHANGED if the block contains at least one changed record, and QUERY if the block contains only valid records that have been retrieved from the database.

TOP_RECORD Returns the record number of the topmost visible record in the given block.

UPDATE_ALLOWED Returns the VARCHAR2 value TRUE if the Update Allowed block property is Yes, FALSE if it is No. This property determines whether the operator or the application is allowed to update records in the block.

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.

GET_BLOCK_PROPERTY Examples

 /*

** Built-in: GET_BLOCK_PROPERTY
** Example: Return the screen line of the current record in
** a multi-record block. Could be used to
** dynamically position LOV to a place on the
** screen above or below the current line so as to
** not obscure the current record in question.
*/
FUNCTION Current_Screen_Line
RETURN NUMBER IS
cur_blk VARCHAR2(40) := :System.Cursor_Block;
cur_rec NUMBER;
top_rec NUMBER;
itm_lin NUMBER;
cur_lin NUMBER;
bk_id Block;
BEGIN
/*
** Get the block id since we'll be doing multiple
** Get_Block_Property operations for the same block
*/
bk_id := Find_Block( cur_blk );
/*
** Determine the (1) Current Record the cursor is in,
** (2) Current Record which is visible at the
** first (top) line of the multirecord
** block.
*/
cur_rec := Get_Block_Property( bk_id, CURRENT_RECORD);
top_rec := Get_Block_Property( bk_id, TOP_RECORD);
/*
** Determine the position on the screen the first field in
** the multirecord block
*/
itm_lin := Get_Item_Property( Get_Block_Property
(bk_id,FIRST_ITEM),Y_POS);
/*
** Add the difference between the current record and the
** top record visible in the block to the screen position
** of the first item in the block to get the screen
** position of the current record:
*/
cur_lin := itm_lin + (cur_rec - top_rec);
RETURN cur_lin;
END;

SET_BLOCK_PROPERTY Built-in