I want to provide a values (...), (...), ...
to a query. How can this be done with Spring's JDBCTemplate
?
Example query:
with
bookings(date, start_time, end_time, room) as
(
values ('2015-01-01'::date, '10:00'::time, '11:00'::time, 'office a'),
('2015-01-01'::date, '12:00'::time, '17:00'::time, 'office a'),
('2015-01-02'::date, '12:00'::time, '17:00'::time, 'meeting')
)
select * from bookings
I cannot find out how to bind the non-fixed list of values to one or multiple parameters dynamically. In the example, I have three rows, but I want to support any number of rows.
update
The related question does not really solve my question. I am not doing a batch update. I am providing a dynamic table via values (...), (...), ...
to a CTE clause which I can use in the rest of the CTE query.