Hi Vijay,

Thanks for the clarification. You have several options:

1. Increment the value in your Record
2. Don't use setRecord(), but set values one by one on your UpdateQuery
3. Use setRecord(), and then overwrite the value for your specific field
using a new value

UpdateQuery is a mutable representation of your UPDATE statement. It can be
changed various times prior to execution...

Hope this helps,
Lukas


2014-02-19 8:59 GMT+01:00 Vijay Ganesan <[email protected]>:

>
> Actually I meant to say update:
> Table<Record> table = ...
> UpdateQuery<Record> update = this.context.updateQuery(table);
> update.setRecord(...*some record where I want to say add() for a field.*
> ..);
> update.addConditions(...some condition...);
>
> On Tuesday, February 18, 2014 10:16:02 PM UTC-8, Vijay Ganesan wrote:
>>
>>
>> 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.

Reply via email to