Hi Daniel,

this is an interesting one.

The one thing that is currently not supported is the inner part of your 
subquery:

        VALUES
        ('xxx', 'yyy'),
        ('zzz', 'ttt')

But in theory you should be able to make your own subquery class by subclassing 
DBQuery and overriding addSQL(StringBuilder buf, long context).
Then you can use this as show in the example SampleAdvApp.querySample();

This seems like a feasible approach to me – although I haven’t tried.

Regards,
Rainer

from: Daniel Weidele [mailto:[email protected]]
to: [email protected]
subject: Support for Update of Composite Primary Key

Hi,
I am wondering if there is some support for a query in this style:
UPDATE  t
SET     value = 99
FROM    (
        VALUES
        ('xxx', 'yyy'),
        ('zzz', 'ttt')
        ) v (in_x, in_y)
JOIN    mytable t
ON      t.x = in_x
        AND t.y = in_y

This *batch* updates particular rows of a table (e.g. with composite primary 
key), where the row identifiers are given input.
I am curious about your thoughts on this!
Cheers,
Daniel

Reply via email to