select apv.package_key from apm_package_versions apv, apm_package_dependencies apd where apd.version_id = apv.version_id and apv.enabled_p = 't' and apd.dependency_type in ('extends', 'embeds') and apd.service_uri = :package_key select package_key from apm_package_types where implements_subsite_p = 't' select inherit_templates_p from apm_package_types where package_key = :package_key select apd.service_uri, apd.dependency_type from apm_package_versions apv, apm_package_dependencies apd where apv.package_key = :package_key and apv.installed_p = 't' and apd.version_id = apv.version_id and (apd.dependency_type = 'embeds' or apd.dependency_type = 'extends' and :inherit_templates_p = 't') order by apd.dependency_id select apd.service_uri from apm_package_versions apv, apm_package_dependencies apd where apv.package_key = :package_key and apv.installed_p = 't' and apd.version_id = apv.version_id and apd.dependency_type in ('extends', 'embeds') order by apd.dependency_id desc select apd.service_uri from apm_package_versions apv, apm_package_dependencies apd where apv.package_key = :package_key and apv.installed_p = 't' and apd.version_id = apv.version_id and apd.dependency_type in ('requires', 'embeds', 'extends') order by apd.dependency_id desc select case when count(*) = 0 then 0 else 1 end from apm_package_versions where version_id = :version_id and enabled_p = 't' select distinct package_key from apm_package_versions where enabled_p='t' order by package_key select parameter_name from apm_parameters where package_key = :package_key select 1 from apm_package_types where package_key = :package_key select 1 from apm_package_versions where version_id = :version_id and installed_p = 't' update apm_parameters set parameter_name = :parameter_name, default_value = :default_value, datatype = :datatype, description = :description, section_name = :section_name, min_n_values = :min_n_values, max_n_values = :max_n_values where parameter_id = :parameter_id update acs_objects set title = :parameter_name where object_id = :parameter_id select package_id, parameter_id, parameter_name from apm_packages p, apm_parameters ap where p.package_key = ap.package_key and ap.parameter_id = :parameter_id select version_id from apm_enabled_package_versions where package_key = :package_key select version_id from apm_package_versions where package_key = :package_key select package_id from apm_packages where package_key = :package_key select pretty_name, version_name, package_key, installed_p, distribution_uri, tagged_p from apm_package_version_info where version_id = :version_id select node_id from site_nodes where object_id = :package_id select parameter_name, attr_value from apm_parameters p, apm_parameter_values v, apm_packages a where p.scope = 'instance' and p.parameter_id = v.parameter_id and a.package_id = v.package_id and a.package_id = :package_id select proc from apm_package_callbacks where version_id = :version_id and type = :type insert into apm_package_callbacks (version_id, type, proc) values (:version_id, :type, :proc) update apm_package_callbacks set proc = :proc where version_id = :version_id and type = :type delete from apm_package_callbacks where version_id = (select version_id from apm_enabled_package_versions where package_key = :package_key) and type = :type select v.version_id, v.package_key, v.version_name, v.version_uri, v.summary, v.description_format, v.description, to_char(v.release_date, 'YYYY-MM-DD') as release_date, v.vendor, v.vendor_uri, v.enabled_p, v.installed_p, v.tagged_p, v.imported_p, v.data_model_loaded_p, v.cvs_import_results, v.activation_date, v.deactivation_date, v.item_id, v.content_length, v.distribution_uri, v.distribution_date, v.auto_mount, t.pretty_name, t.pretty_plural from apm_package_versions v, apm_package_types t where v.version_id = :version_id and t.package_key = v.package_key select pretty_name, package_key from apm_package_types where implements_subsite_p = 't' and package_key in ($in_clause) order by pretty_name update apm_packages set package_key = :new_package_key where package_id = :package_id select parameter_name, parameter_id from apm_parameters where package_key = :old_package_key select parameter_id as new_parameter_id from apm_parameters where package_key = :new_package_key and parameter_name = :parameter_name update apm_parameter_values set parameter_id = :new_parameter_id where parameter_id = :parameter_id and package_id = :package_id