The tutorial is given below to how to select multiple records in Oracle Forms.
In the following example, we will create a tabular data block based on the EMP table, a checkbox, a multiline textbox and a push button. We will give a functionality to the user that after executing the query, the user can select the records using checkbox and after clicking on the button, it will show the selected employee numbers in the multiline textbox.
Follow These Steps to Perform This Task
1. Create a tabular data block based on any table and open the layout editor.
2. In the layout editor, create a checkbox in the same tabular data block and set the following properties.
- Value When Checked: Y
- Value When Unchecked: N
- Database Item: No
- Initial Value: N
3. Create a Push Button and on the When-Button-Pressed Trigger, write the following code:
DECLARE v_string VARCHAR2 (4000); BEGIN GO_BLOCK ('emp'); FIRST_RECORD; LOOP IF :emp.c_cb = 'Y' THEN v_string := v_string || :emp.empno || ', '; END IF; IF :SYSTEM.LAST_RECORD = 'TRUE' THEN EXIT; END IF; NEXT_RECORD; END LOOP; FIRST_RECORD; :emp.selected_items := RTRIM (v_string, ', '); END;
Your form is ready now and you can test it by running it.
Also, you can download this form via the following link:
hi .
question
if i have a tlist in oracle forms and i need to select multiple values from the list and
use selected value to run a query . using set_block_property default where
can you advice or give an example for this matter ?????
You can get list element using the following code:
After completing the loop you will have the multiple values separated by comma into the variable v_values.
You can use then its value in SQL query to filter records.
ok , first thank you for advice but my problem is i need to get more one value in two separated lists like in picture one for first_name and one for dept_name and hire date between d1 and d2
i need to do search button set_block_property default where
can you help me with this situation
You can check the following post on setting default_where for custom search filters:
Oracle Forms default_where example for custom search
If it does not solve your problem, then please ask your question on orclqa.com in more detail so that other community members can help you better.