EXECUTE_QUERY in Oracle Forms

By

Syntax

PROCEDURE EXECUTE_QUERY;
PROCEDURE EXECUTE_QUERY (keyword_one    VARCHAR2);

PROCEDURE EXECUTE_QUERY (keyword_two    VARCHAR2);

PROCEDURE EXECUTE_QUERY (keyword_one    VARCHAR2, keyword_two    VARCHAR2);

PROCEDURE EXECUTE_QUERY (keyword_one    VARCHAR2, keyword_two    VARCHAR2, locking    VARCHAR2);

Built-in Type  restricted procedure

Enter Query Mode  yes

Parameters

no parameters EXECUTE_QUERY flushes the current block, opens a query, and fetches a number of selected records.

keyword_one EXECUTE_QUERY(ALL_RECORDS) performs the same actions as EXECUTE_QUERY except that Form Builder fetches all of the selected records.

keyword_two EXECUTE_QUERY(FOR_UPDATE) performs the same actions as EXECUTE_QUERY except that Form Builder attempts to lock all of the selected records immediately.

keyword_one/ keyword_two EXECUTE_QUERY(ALL_RECORDS, FOR_UPDATE) performs the same actions as EXECUTE_QUERY except that Form Builder attempts to lock all of the selected records immediately and fetches all of the selected records.

locking    Can be set to NO_WAIT anytime that you use the FOR_UPDATE

parameter.  When you use NO_WAIT, Form Builder displays a dialog to

notify the operator if a record cannot be reserved for update immediately.

Without the NO_WAIT parameter, Form Builder keeps trying to obtain a lock without letting the operator cancel the process.

Use the NO_WAIT parameter only when running against a data source that supports this functionality.
 
EXECUTE_QUERY restrictions

Oracle Corporation recommends that you use the ALL_RECORDS and FOR_UPDATE parameters with caution. Fetching a large number of rows could cause a long delay. Locking a large number of rows at once requires many resources.

EXECUTE_QUERY examples

/*
    Built-in:  EXECUTE_QUERY
    Example:   Visit several blocks and query their contents,
    then go back to the block where original block.
*/
DECLARE
block_before VARCHAR2(80) := :System.Cursor_Block;
BEGIN

Go_Block(’Exceptions_List’);
Execute_Query; Go_Block(’User_Profile’);
Execute_Query;
Go_Block(’Tasks_Competed’);
Execute_Query;
Go_Block( block_before );

END;