Title: Queries and Lookups
1Queries and Lookups
2Simple Department Form
3The Simple Form
Insert
Save
LOVBUT
4Adding a Department
5Query By Example
6More Querying
Fetch all departments that begin with SAL
7Adding Manager Info
8Revised Module -- Insertion
9Querying with Revised Module
- Manager Fields do not fill in automatically
- So we would like to to improve the querying
capability - Unless form is primarily for data entry.
- One method base form on a view
10Defining a View
11Basing Module on View
12Module Diagram
- View is considered a table on module side.
- No internal structure.
13The Form
- Querying now works as desired
- But no lookup LOV for data entry!
- Maybe we can add a lookup
14Add a Lookup
Note a view can have a primary key and foreign
keys!
15The New Version
16Unfortunately ...
- Form Compiler Blows UP
- Diagnostic messages about .cpp files
- Tell your Oracle Representative
- Lesson, dont add lookups to a table already in a
view! - But there is another way, closely related ...
17Module Views
18Module View Looks Like Ordinary Module
19Module Component API
- Oracle Designer creates the view for you,
- when you tell it to.
- Use MCAPI.
- Creates DDL for the view
20The Underlying View
CREATE OR REPLACE VIEW cgvMDPT_MV_DEPARTMENT (DN
UMBER,DNAME,. . ., L_EMP_LNAME)
AS SELECT DPT.DNUMBER DNUMBER, DPT.DNAME DNAME,.
. . ., L_EMP.LNAME L_EMP_LNAME FROM EMPLOYEES
L_EMP,DEPARTMENTS DPT WHERE DPT.EMP_EMPID
L_EMP.EMPID () /
21The View Based Form
22Querying
23Inserting New Data
24Adding an Item Group