form data source by join
TRANSCRIPT
-
8/3/2019 Form Data Source by Join
1/7
-
8/3/2019 Form Data Source by Join
2/7
8. Locking Mode: Delayed9. Key Mode: Updateable
10. DML Data Target Name: hr.employees, hr.departments
11. Show Scroll Bar: yes12. Scroll Bar Canvas: EMP_DEPT
13. Scroll Bar X Position: 50014. Scroll Bar Y Position: 42
15. Scroll Bar Width: 14
16. Scroll Bar Height: 140 Note: Key Mode = Updatable instructs Forms to perform any DML statements using the Primary Key values.
6. Add the following Block Items and set their properties as indicated:1. Name: Employee_id
i. Data Type: Numberii. Maximum Length: 6iii. Column Name: hr.employees.employee_idiv. Primary Key: Yesv. Prompt: Employee IDvi. Prompt Attachment Edge: Topvii. Prompt Alignment: Center
2. Name: First_namei. Date Type: Charii. Data Length Semantics: Byte
iii. Maximum Length: 20iv. Column Name: hr.employees.first_namev. Prompt: First Namevi. Prompt Attachment Edge: Topvii. Prompt Alignment: Center
3. Name: Last_namei. Data Type: Charii. Data Length Semantics: Byte
-
8/3/2019 Form Data Source by Join
3/7
iii. Maximum Length: 20iv. Column Name: hr.employees.last_namev. Prompt: Last Name
vi. Prompt Attachment Edge: Topvii. Prompt Alignment: Center
4. Name: Job_idi. Data Type: Charii. Data Length Semantics: Byteiii. Maximum Length: 20iv. Column Name: hr.employees.job_idv. Prompt: Job IDvi. Prompt Attachment Edge: Topvii. Prompt Alignment: Center
5. Name: Manager_idi. Data Type: Numberii. Maximum Length: 6iii. Column Name: hr.employees.employee_idiv. Prompt: Manager IDv. Prompt Attachment Edge: Topvi. Prompt Alignment: Center
6. Name: Salaryi. Data Type: Numberii. Maximum Length: 11
iii. Column Name: hr.employees.salaryiv. Prompt: Salaryv. Prompt Attachment Edge: Topvi. Prompt Alignment: Center
7. Name: Department_namei. Data Type: Charii. Data Length Semantics: Byteiii. Maximum Length: 30
-
8/3/2019 Form Data Source by Join
4/7
iv. Column Name: hr.departments.department_namev. Prompt Name: Department Namevi. Prompt Attachment Edge: Top
vii. Prompt Alignment: Center7. Add the items to a Canvas using the Layout Wizard.
i. Select EMP_DEPT_JOIN as the data blockii. Select all available fieldsiii. Select Tabular layoutiv. Enter Employee Information as the Frame Titlev. Set number of record displayed = 10vi. Check the Display Scrollbar optionvii. Click Finish
8. At this point you should have a form that look similar to the following:
-
8/3/2019 Form Data Source by Join
5/7
9. Now run your form and press Ctrl + F11 to query data into the EMP_DEPT_JOIN block. Your Forms Runtime
should look like the following:
-
8/3/2019 Form Data Source by Join
6/7
Youre done! You have successfully based a Forms Data Block on two tables by joining them through the WHEREClause of the data block.
How many tables you join in your block is up to you. I have successfully joined 6 tables. The advantage of joining tables
-
8/3/2019 Form Data Source by Join
7/7
in your block is that the result set is faster than the traditional block based on the primary table and using a Post-Querytrigger to display the relevant data from the joined tables.