CREATE OR REPLACE FUNCTION insert_person (
  boolean,   -- cexperience
  boolean,   -- wexperience
  integer    -- agegroupid
) RETURNS integer AS $$
DECLARE
  par_cexperience  ALIAS FOR $1;
  par_wexperience  ALIAS FOR $2;
  par_agegroupid   ALIAS FOR $3;

  var_personid     integer;
BEGIN
  INSERT INTO tbl_person (
    cexperience,
    wexperience,
    agegroupid
  ) VALUES (
    par_cexperience,
    par_wexperience,
    par_agegroupid
  );

  SELECT INTO var_personid seq_person.last_value;

  RETURN var_personid;
END;
$$ LANGUAGE plpgsql;