Bind Variables - types and error scenario
By sharavnkumar_malla on Feb 26, 2013
There are two types of Bind Variables in ADF. Improper use of these bind variables might result in errors which are hard to debug as the error statements are misleading.
Let us look at them in detail.
1.Bind Variable of the type"where"
While declaring Bind Variable, if you specify the bind variable as "required", then its type will be "where".
Entry of the corresponding bind variable in xml file:
Variable of kind "view criteria"
If you do not check the "required" check box,then the bind variable will be of type "view criteria"
Error scenario pertaining to Bind Variables:
If you are using a bind variable in the query directly as shown below, then you should use bind variable of type where.
Scenario 1: If you are using the bind variable in the query and the bind variable is not "required", then you will get the following error.(This error occurs even if the Bind Variable has a default value)
Scenario 2: If you are using a bind variable in the view criteria and marked it as "required" too, you will get the following error if you are executing the query without applying the view criteria.
If bind variable is marked as required,
and if the bind variable is getting used in the query directly, then there won't be any errors.
and if the bind variable is used in view criteria and the view criteria is applied before the query gets executed, then there will not be any errors.
So, if you are using the bind variable in the view criteria and if you mark it as required, then make sure that you apply the view criteria before the query gets executed.