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 parameter_id, parameter_name from apm_parameters where 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) delete from apm_package_files where version_id = :version_id select package_key, version_id from apm_package_version_info where version_id = :version_id select path from apm_package_files where version_id = :version_id and file_type = 'package_spec' and path = :info_file_name update apm_package_types set spec_file_path = :path where package_key = :package_key