-- -- acs_activity__edit/5 -- create or replace function acs_activity__edit( integer, character varying, text, boolean, text ) returns int4 as $$ declare edit__activity_id alias for $1; edit__name alias for $2; -- default null, edit__description alias for $3; -- default null, edit__html_p alias for $4; -- default null edit__status_summary alias for $5; -- default null begin update acs_activities set name = coalesce(edit__name, name), description = coalesce(edit__description, description), html_p = coalesce(edit__html_p, html_p), status_summary = coalesce(edit__status_summary, status_summary) where activity_id = edit__activity_id; update acs_objects set title = coalesce(edit__name, name) where activity_id = edit__activity_id; return 0; end;$$ language plpgsql;