Im trying to update a few rows in an oracle sql database and return the ids of the items which were updated for further processing by utilizing the sql returning feature
simplified example query to perform a bulk update on the database
val sql = """
DECLARE
TYPE idType IS TABLE OF users.id%TYPE;
ids idType;
BEGIN
UPDATE users SET name = name
RETURNING id BULK COLLECT INTO ids;
end;
"""
val cs = jdbcTemplate.dataSource.connection.prepareCall(sql)
cs.registerOutParameter("ids", Types.ARRAY)
cs.execute()
val result = cs.getArray("ids")
The query works but Im unable to register the out parameter and/or get the result of the operation