mergeset_int(p_add_id integer, p_set_id integer)

8.78. mergeset_int(p_add_id integer, p_set_id integer)

Function Properties

Language: PLPGSQL

Return Type: integer

mergeSet_int(set_id, add_id) - Perform MERGE_SET event, merging all objects from set add_id into set set_id.

begin
	-- ----
	-- Grab the central configuration lock
	-- ----
	lock table sl_config_lock;

	update sl_sequence
			set seq_set = p_set_id
			where seq_set = p_add_id;
	update sl_table
			set tab_set = p_set_id
			where tab_set = p_add_id;
	delete from sl_subscribe
			where sub_set = p_add_id;
	delete from sl_setsync
			where ssy_setid = p_add_id;
	delete from sl_set
			where set_id = p_add_id;

	return p_set_id;
end;