apm::package_version::attributes::store (private)

 apm::package_version::attributes::store -version_id version_id \
    -array array

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Store the dynamic attributes of a certain package version in the database.

Switches:
-version_id (required)
The id of the package version to store attribute values for
-array (required)
The name of the array in the callers scope containing the attribute values to store
Author:
Peter Marklund

Testcases:
No testcase defined.
Source code:
    upvar $array attributes

    db_transaction {
        db_dml clear_old_attributes {
            delete from apm_package_version_attr
            where version_id = :version_id
        }

        array set dynamic_attributes [apm::package_version::attributes::get_spec]
        foreach attribute_name [array names dynamic_attributes] {
            if { [info exists attributes($attribute_name)] } {
                set attribute_value $attributes($attribute_name)

                db_dml insert_attribute {
                    insert into apm_package_version_attr
                    (attribute_name, attribute_value, version_id)
                    values (:attribute_name, :attribute_value, :version_id)
                }
            }
        }
    }
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: