I have boxed it in a little more - it appears that there is something wrong with the execution of the sub query used by the ALTER statement. If I run the following on the SQL Console
select "MEDPORTAL"."adsm.data::Obs_Data_ID".NEXTVAL from dummy;
>> Result = 208 (I've been testing, it started at 201)
SELECT IFNULL(MAX(ID), 0) + 200 FROM "MEDPORTAL"."adsm.data::OBS_DATA";
>> Result = 33,565
ALTER SEQUENCE "MEDPORTAL"."adsm.data::Obs_Data_ID" RESET BY SELECT IFNULL(MAX(ID), 0) + 200 FROM "MEDPORTAL"."adsm.data::OBS_DATA";
>> Result =
Statement 'ALTER SEQUENCE "MEDPORTAL"."adsm.data::Obs_Data_ID" RESET BY SELECT IFNULL(MAX(ID), 0) + 200 FROM ...'
successfully executed in 68 ms 962 µs (server processing time: 9 ms 309 µs) - Rows Affected: 0
select "MEDPORTAL"."adsm.data::Obs_Data_ID".NEXTVAL from dummy;
>> Result = 209, this should have been altered by the statement above.
My assumption is that it has to be linked to the IFNULL execution or something in the ALTER SEQUENCE statement (which calls the IFNULL)
Thanks for looking.