-- -- acs_activity__name/1 -- create or replace function acs_activity__name( integer ) returns varchar as $$ -- acs_activities.name%TYPE declare name__activity_id alias for $1; v_activity_name acs_activities.name%TYPE; begin select name into v_activity_name from acs_activities where activity_id = name__activity_id; return v_activity_name; end;$$ language plpgsql;