attribute::exists_p (public)

 attribute::exists_p [ -convert_p convert_p ] object_type \
    orig_attribute

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

Returns 1 if the object type already has an attribute of the given name.

Switches:
-convert_p (optional, defaults to "t")
If t, we convert the attribute using plsql_utility::generate_oracle_name
Parameters:
object_type (required)
orig_attribute (required)
The attribute in which we are interested. Note that if convert_p is set to t, we will internally look for the converted attribute name
Returns:
1 if the object type already has an attribute of the specified name. 0 otherwise
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::exists_p attribute::exists_p test_acs_subsite_attributes->attribute::exists_p db_string db_string (public) attribute::exists_p->db_string plsql_utility::generate_oracle_name plsql_utility::generate_oracle_name (public) attribute::exists_p->plsql_utility::generate_oracle_name packages/acs-subsite/www/admin/attributes/add-2.tcl packages/acs-subsite/ www/admin/attributes/add-2.tcl packages/acs-subsite/www/admin/attributes/add-2.tcl->attribute::exists_p

Testcases:
acs_subsite_attributes
Source code:
        if { $convert_p == "t" } {
            set attribute [plsql_utility::generate_oracle_name $orig_attribute]
        } else {
            set attribute $orig_attribute
        }

        set attr_exists_p [db_string attr_exists_p {
           select 1 from acs_attributes a
           where (a.attribute_name = :attribute or a.column_name = :attribute)
           and a.object_type = :object_type
        } -default 0]

        if { $attr_exists_p || $convert_p == "f" } {
            return $attr_exists_p
        }
        return [exists_p -convert_p f $object_type $orig_attribute]
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: