Hello,
I am searching a way for doing this :
UPDATE XXX where *(select count(*) from XXX where ... )=0* and ...
I have try with correlated subquery but it doesn't work, my subquery become
a field that I use into the update's where clause. But on runtime, this
field is not replace by the suybquery.
Do you know why ?
Example :
// select subquery
Field<Object> lockedData = query
.selectCount()
.from(SUPPORT)
.where(SUPPORT.ID.equal("XXXX")
.and(SUPPORT.BUSINESSLOCK.equal("Process2#1").and(
SUPPORT.BUSINESSLOCK.isNull()))).asField("lockedData");
//update query
int result = query.update(SUPPORT).set(SUPPORT.STATUS, 100)
.where(lockedData.equal(0).and(SUPPORT.ID.equal("XXXXX"))).execute();
At runtime, this update is executed :
update "APP"."SUPPORT" set "APP"."SUPPORT"."STATUS" = 100 where
("lockedData" = 0 and "APP"."SUPPORT"."ID" = 'AET_SUPPORT')
Thanks for your help.
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.