Hello, > Tell me what you think, maybe it's a strange feature that seems useful only > to me :-D
I had thought of this before. I guess, the optimal way is to allow for adding a flag to Factory.val() and Factory.param(), in order to indicate that the bind value should always be inlined, never rendered as a bind variable. Alternatively, instead of overloading val() and param(), the new methods could be called inlineVal(), inlineParam()... I have created a feature request for this: https://sourceforge.net/apps/trac/jooq/ticket/1302 Cheers Lukas 2012/4/12 <[email protected]>: > Hi. > > It would be useful if you could decide selectively whether a query value > parameter is > rendered as constant or a named param. > > Suppose that in the next query I want 'A' rendered in SQL as constant > whereas bids a named param like ":bids": > > private SelectConditionStep mySelect(Integer[] ids, char status) { > return create.select(TABLE.A_COLUMN) > .from(TABLE) > .where(TABLE.ID.in(bids)) > .and(TABLE.STATUS.equal('A')); > } > > At the moment it seems there's no a simple way to do that. > (maybe with some plain sql stuff injected ?!??) > > I want to reuse mySelect query in other queries elsewhere, specifying only > "bids" > as named param when I do jdbc queries (and not the parameter that are > constant, like the 'A'). > > In the final query, if I use renderNamedParams I get all value binded as > ":something", If I use getSQL(true) > bids value is rendered constant in the SQL. > > I would be very useful to "tag" a value to be rendered constant even when > you render > SQL with renderNamedParams. > > Tell me what you think, maybe it's a strange feature that seems useful only > to me :-D > > Thanks. > > P.S: Jooq is a very good project. So keep going this way :-D !!!
