update apm_package_versions
set installed_p = 'f', enabled_p = 'f'
where package_key = :package_key
select count(*) from apm_package_versions
where package_key = :package_key
select parameter_id from apm_parameters
where parameter_name = :parameter_name
and package_key = :package_key
select dependency_id from apm_package_dependencies
where version_id = :version_id
delete from apm_package_owners where version_id = :version_id
insert into apm_package_owners(version_id, owner_uri, owner_name, sort_key)
values(:version_id, :owner_uri, :owner_name, :counter)
select package_key, version_id
from apm_package_version_info
where version_id = :version_id
update apm_package_types
set spec_file_path = :path
where package_key = :package_key
delete from apm_package_callbacks
where version_id = :version_id
select ap.parameter_id
from apm_parameters ap
where ap.package_key = :package_key
and exists (select 1
from apm_parameters ap2, apm_package_dependencies apd
where ap2.package_key = apd.service_uri
and ap2.parameter_name = ap.parameter_name
and apd.dependency_id = :dependency_id)
select ap.*
from apm_parameters ap
where package_key = :new_package_key
and parameter_name = :parameter_name
select ap.*
from apm_parameters ap
where package_key = :inherited_package_key
and scope = 'instance'