It is a little known fact that SQL operators such as "between", "in", and "is not null" as well as built in functions such as "nvl", "to_date", and "length" are all available for use when querying in Oracle Application Forms. Normal forms querying is available in conjunction with the complex queries. To accomplish this, simply:
1. Invoke "Enter Query" mode
2. In the desired
field(s), enter a ":" (colon) followed by a variable name. This will
create a bind variable that can
subsequently be
used in a complex query.
3. In the desired field(s), enter normal query criteria.
4. Execute the Query
5. In the "Query/Where" window that appears, enter the query using the bind variable and click the "OK" button. The query will execute and return the appropriate data. Do NOT include the word where.
As an example, suppose it is useful to query all Employees with Hire Dates between 01-JAN-1999 and 31-JAN-1999 in the Oracle Human Resources People Enter and Maintain form:
1. Invoke "Enter Query" mode
2. In the Hire Date field, enter :hire_date
3. In the Type field, enter Employee
4. Execute the Query
5. In the "Query/Where"
window that appears, enter trunc(:hire_date) between to_date('01-JAN-1999','DD-MON-YYYY')
and to_date('31-JAN-1999','DD-MON-YYYY')
6. Click the 'OK' button. The query will execute and return the desired data.
Return to : Oracle
Database, SQL, Application, Programming Tips