--
-- apm__parameter_p/2
--
create or replace function apm__parameter_p(
  character varying,
  character varying
) returns int4 as $$

declare
  parameter_p__package_key            alias for $1;  
  parameter_p__parameter_name         alias for $2;  
  v_parameter_p                       integer;       
begin
    select case when count(*) = 0 then 0 else 1 end into v_parameter_p 
    from apm_parameters
    where package_key = parameter_p__package_key
    and parameter_name = parameter_p__parameter_name;

    return v_parameter_p;
   
end;$$ language plpgsql;