Using Parametrized WHERE Clauses

If you have some, but not complete, information about the WHERE clause you want for a view object definition, you can dynamically set individual WHERE clause parameters in particular view object instances at runtime.

To parametrize the WHERE clause in a view object definition:

  1. Open the View Object Editor by doing one of the following:
  2. Select the Query node.
  3. In the Where field, enter a WHERE clause using parameters. Do not include the word "WHERE". Unless you are running against a non-Oracle database, we suggest you use Oracle-style parameters:

    ORDER_TOTAL > :1 + :2

    :1 is the first parameter, and :2 is the second parameter.

    If you are running against a non-Oracle database, you will need to use ?-style parameters:

    ORDER_TOTAL > ? + ?

    In this case, the first ? is the first parameter, and the second ? is the second parameter.

  4. If you have used ?-style parameters, ensure that Use ? Style Parameters is checked.

To specify parameter values for a particular view object instance at runtime:

  1. For each parameter, create an Object (usually a String) containing the value of the parameters:
    String firstParam = "500";
    
    
    
    String secondParam = "1000";                
  2. Do one of the following:

Ways to Change View Object Queries at Runtime
About View Objects
About View Object and View Link Instances
Specifying a Custom Query for a View Object Definition
Finding View Object Instances in the Data Model
Developing Oracle ADF Business Components for Oracle9i Lite and Non-Oracle Datasources
About Modeling Business Components

 

 

 

Copyright © 1997, 2004, Oracle. All rights reserved.