Sunday, January 16, 2022

Search Option in Oracle Form

 

Search Option in Oracle Form

Step 1:

To begin, make two blocks in the data block. “Block4” and “EMP

·         EMP block is database block.

·         Block4 is manual block or non-database block.

 

Search Option in Oracle Form

 In “EMP Block” just fetch the data from database.

Search Option in Oracle Form

In “Block4” just manually create two non-database item.

·         First one is text-item.

·         Second one is button.

Search Option in Oracle Form

Step 2:

Following that, both goods were successfully produced. "Block4" requires a horizontal canvas.

Search Option in Oracle Form

Step 3:

Double-click on the "Block4" canvas after that. Then go back to the search box you created earlier. Create the "WHEN-BUTTON-PRESSED" trigger. F11 is a shortcut for listing down the triggers.

Search Option in Oracle Form

 Step 4:

Then insert all of the code listed below into the "WHEN-BUTTON-PRESSED" trigger.

DECLARE

                V_BLOCK_VAL VARCHAR2(100);

BEGIN

                V_BLOCK_VAL := :BLOCK4.TEXT_ITEM6;

               

                IF GET_ITEM_PROPERTY('SEARCH',PROMPT_TEXT)='SEARCH' THEN

                                MESSAGE(GET_ITEM_PROPERTY('SEARCH',PROMPT_TEXT));

                                GO_BLOCK('EMP');

                               

                SET_BLOCK_PROPERTY('EMP',DEFAULT_WHERE,'SAL LIKE '''||:BLOCK4.TEXT_ITEM6||'%'||'''');

                               

                                SET_ITEM_PROPERTY('SEARCH',LABEL,'Search');

                                EXECUTE_QUERY;

                ELSE

                                SET_BLOCK_PROPERTY('EMP',DEFAULT_WHERE,'');

                                SET_ITEM_PROPERTY('PUSH_BUTTON14',LABEL,'SEARCH');

                END IF;

                END;

Search Option in Oracle Form


Step 5:

Now run the form. Button to run the form show in vertical toolbar.

Search Option in Oracle Form

Output:

Search Option in Oracle Form

Search Option in Oracle Form



If you have any problem so download the file to click on "Download".

Download

 I hope it's helpful for you. If you have any queries, don't hesitate to contact me.

Name : Muhammad Sahal Qasim
E-mail : s.m.sahal789@gmail.com
Thank you.

0 comments:

Post a Comment

If you have any doubts, please let me know. I will help you.