Tuesday, May 3, 2011

ADF BC : Creating Bind Variable at Run Time

 

By default we can create the bind variable for view object declaratively and set it value programmatically using

ViewObject viewobj = am.findViewObject(“voname”);

viewobj.setNamedWhereClauseParam(“depid”,123);

viewobj.executeQuery();

Dynamic Bind Variable

now suppose you want managerid as bind variable runtime.

viewobj.setWhereClause(“ManagedId = :managerid”); //:managerid is bind var

viewobj.defineNamedWhereClauseParam(“managerid”,null ,null);

viewobj.setNamedWhereClauseParam(“managedid”,234)

viewobj.executeQuery();

1 comment:

  1. Hi use of Dynamic bind variable is giving
    oracle.jbo.InvalidOperException: JBO-25070: Where-clause param variable type needs ordinal index array.

    ReplyDelete