Hello Vijay.
I'm not sure how incrementing a value fits with inserting a record. You
probably want to update the record?
http://www.jooq.org/doc/3.3/manual/sql-building/sql-statements/update-statement
You'd then write something along the lines of this:
create.update(TABLE)
.set(TABLE.VALUE, TABLE.VALUE.add(1)) .where(TABLE.ID.equal(3));
Cheers
Lukas
2014-02-19 7:16 GMT+01:00 Vijay Ganesan <[email protected]>:
>
> Have this way of inserting a Record:
> Table<Record> table = ...
> InsertQuery<Record> insertQuery = context.insertQuery(table);
> Record> record = ... create record and set values for columns ....
> insertQuery.addRecord(record);
>
> Now, what I want is - for a particular integer column in the record, I
> want to set value to be 'current value + 1' i.e. increment the current
> column value that exists in the database for that row by 1. How can I do
> this? Unclear how Field's add() be use in conjunction with this approach of
> inserting a Record.
>
> --
> 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/groups/opt_out.
>
--
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/groups/opt_out.