can i use dynamic query in bds and how?
for my step1:
bds1=> in getInitialLookupQuery methode i have ; query= "select distinct op.numCompte, op.codePops from TOperation op"
in my processJobStep methode i read the recorde from bds1 and i get 'numCompte' and 'codePops' witch i will use in my dynamique query of bds2
bds2=> getInitialLookupQuery methode: "select op from TOperation op where op.numCompt=" X+
"and op.codePops=" Y+
what X and Y will be ?
Re: dynamic query2012-05-22T13:00:44ZThis is the accepted answer. This is the accepted answer.Well, yes, you could. There is no "out of the box" BDS to do that. You would have to implement your own BDS class by implementing the BatchDataStream interface. But the better question is why would you use a BDS for dynamic query? There are two reasons to use a BDS:
- You want a restartable stream. Since you are doing dynamic queries, there is no place to restart from. So a BDS does not make sense for that usage.
- You want to be able to swap implementations (e.g. unit test vs production) by simply modifying the xJCL. That might apply to your case.
If neither of these reasons apply to your case, then I recommend you simply read from your primary BDS and then do your dynamic queries directly from your batch job step.