select pretty_name as instance_name
from apm_package_types
where package_key = :package_key
select instance_name, package_key
from apm_packages
where package_id = :package_id
and section_name=:section
select p.parameter_name,
coalesce(p.description, 'No Description') as description,
v.attr_value,
coalesce(p.section_name, 'main') as section_name,
p.datatype
from apm_parameters p left outer join
(select v.parameter_id, v.attr_value
from apm_parameter_values v
where (v.package_id = :package_id or v.package_id is null)) v
on p.parameter_id = v.parameter_id
where p.package_key = :package_key
and p.scope = :scope
$section_where_clause
order by
case when lower(section_name) = 'deprecated'
then null
when section_name is null
then '1'
else section_name end, parameter_name
select p.parameter_name as c__parameter_name
from apm_parameters p left outer join
(select v.parameter_id, v.attr_value
from apm_parameter_values v
where (v.package_id = :package_id or v.package_id is null)) v
on p.parameter_id = v.parameter_id
where p.package_key = :package_key
and p.scope = :scope
$section_where_clause