Sort Detail Data Block Example - Oracle Forms

Example is given below to sort detail data block data (toggle asc or desc) with push buttons used as header of grid, by setting ORDER_BY property of data block using SET_BLOCK_PROPERTY command.

The following is the screen shot of this example and this form can be downloaded from the below link:

Download

In this example two data block are being used, one is to contain push buttons to sort data and one is to hold the data in detail block.

On every push button of header the following code is written on When-Button-Pressed trigger:

Begin
 If Nvl(Get_Block_Property(‘scott_emp‘, order_by), ‘ENAME ASC‘) = ‘ENAME ASC‘ then
    Set_Block_Property(‘scott_emp‘, order_by, ‘ename desc‘);
 Else    Set_Block_Property(‘scott_emp‘, order_by, ‘ename asc‘);  End if;
 Go_Block(‘scott_emp‘);  Execute_Query;
End;

You see in above example when I am getting the current setting of order by property of the block, I am reading it in upper case because it returns in upper case even if I am setting the property in lower case.

时间: 2024-08-06 23:53:36

Sort Detail Data Block Example - Oracle Forms的相关文章

Create Stacked Canvas to Scroll Horizontal Tabular Data Blocks In Oracle Forms

In this tutorial you will learn to create horizontal scrollable tabular or detail data block by using stacked canvas in Oracle Forms. As shown in below picture the first column Empno is fixed and middle columns Ename, Job, Mgr and Hiredate are scroll

Writing Text File From A Tabular Block In Oracle Forms

The example given below for writing text file or CSV using Text_IO package from a tabular block in Oracle Forms. Suppose there is a tabular grid data block "Job_History" in your forms and you want to write a CSV on click of a button by reading w

Moving From Top To Bottom in Detailed Block in Oracle Forms

Suppose you want to scan a tabular grid block (loop through all records in detail block) from top to bottom in Oracle forms. You can do this task by using :system.last_record system variable to determine whether it is last record in a block and then

8 Most Required Examples Reference For Oracle Forms

Check the following 8 Links for best Oracle Forms examples with source code (Fmb files), which will work in any version of Oracle Forms. The examples are given for "Oracle Form's Triggers", "Hierarchical Trees", "Stacked Canvases&

Oracle Forms Execute_Query Example To Fetch The Records From Database

Execute_Query command is used to fetch all the records for current database data block in Oracle Forms, actually its executes query in current data block. Syntax EXECUTE_QUERY; Clears the current block, opens a query, and fetches a number of selected

Determining Current Block and Current Item in Oracle Forms

SYSTEM.CURSOR_BLOCK Determining current block in Oracle Forms Using SYSTEM.CURSOR_BLOCK system variable. The value that the SYSTEM.CURSOR_BLOCK system variable represents depends on the current navigation unit:If the current navigation unit is the bl

Using CLEAR_BLOCK To Prevent Save Confirmation Dialogs In Oracle Forms

Clear_Block built-in clears all records from the current data block and if the user had made some changes in records which have not been committed, then Oracle Forms processes the records depending on the argument passed to the Clear_Block procedure.

Create Data Block Based On From Clause Query In Oracle Forms

Example is given below to create a data block based on From Clause query in Oracle Forms. The following are the steps: Create a data block manually and set the following properties: You can specify different query as per your need. Then create the it

How To Commit Just One Data Block Changes In Oracle Forms

You have an Oracle Form in which you have multiple data blocks and requirement is to commit just one data block changes and not to effect any other data blocks. But suppose you have a commit_form button also in form which will commit all the data blo