Procedures results

Hi everyone,

I'm running Spotfire Analyst 7.11 in conjunction with a Postgresql server version 10. I have made a Function in Postgres and used it to create a Procedure in Spotfire, as shown below:

create or replace function ins_aloc (char pre, char ref, char mat, timestamp without time zone aloc, char grav, char uf)
returns boolean as
counter integer;
	select count(*) into counter from public.pac t1 where t1.pre = $1 and t1.ref = $2;
		if counter > 0 then
		return false;
		insert into pac (pre, ref, mat, aloc, grav, uf) values($1, $2, $3, $4, $5, $6);
		return true;
	end if;
end; $$
language 'sql';

I would like to be able to get the procedure results (True or False) and insert into a Document.Properties. I will use this DP to show a message to the user about the insertion result (succeed or Failed).

I have been trying to get the result but I didn't realize how to do that.  Thanks in advance.