attribute::value_delete (public)

 attribute::value_delete attribute_id enum_value

Defined in packages/acs-subsite/tcl/attribute-procs.tcl

deletes the specified enumeration value from the attribute. The net effect is that this attribute will have one fewer options for acceptable values.

Parameters:
attribute_id (required)
The attribute from which we are deleting
enum_value (required)
The value of we are deleting
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_attributes acs_subsite_attributes (test acs-subsite) attribute::value_delete attribute::value_delete test_acs_subsite_attributes->attribute::value_delete attribute::delete attribute::delete (public) attribute::value_delete->attribute::delete db_0or1row db_0or1row (public) attribute::value_delete->db_0or1row db_dml db_dml (public) attribute::value_delete->db_dml db_resultrows db_resultrows (public) attribute::value_delete->db_resultrows packages/acs-subsite/www/admin/attributes/value-delete-2.tcl packages/acs-subsite/ www/admin/attributes/value-delete-2.tcl packages/acs-subsite/www/admin/attributes/value-delete-2.tcl->attribute::value_delete

Testcases:
acs_subsite_attributes
Source code:
        # This function should remove all occurrences of the
        # attribute, but we don't do that now.

        if { ![db_0or1row select_last_sort_order {
            select sort_order as old_sort_order
              from acs_enum_values
             where attribute_id = :attribute_id
               and enum_value = :enum_value
        }] } {
            # nothing to delete
            return
        }

        db_dml delete_enum_value {
            delete from acs_enum_values
            where attribute_id = :attribute_id
            and enum_value = :enum_value
        }
        if { [db_resultrows] > 0 } {
            # update the sort order
            db_dml update_sort_order {
                update acs_enum_values
                   set sort_order = sort_order - 1
                 where attribute_id = :attribute_id
                   and sort_order > :old_sort_order
            }
        }

        return
Generic XQL file:
packages/acs-subsite/tcl/attribute-procs.xql

PostgreSQL XQL file:
packages/acs-subsite/tcl/attribute-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/attribute-procs-oracle.xql

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