Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

DB_ATTR_SETDOMAIN_ELM

Among attributes of the class to which the current user has access authorization in the database, if an attribute's data type is a set (set, multiset, sequence), this macro represents the data type of the element of the set.

Attribute Name

Data Type

Description

attr_name

VARCHAR(255)

Attribute name

class_name

VARCHAR(255)

Name of the class to which the attribute belongs

attr_type

VARCHAR(8)

‘INSTANCE’ for an instance attribute, 'CLASS' for a class attribute, and 'SHARED' for a shared attribute.

data_type

VARCHAR(9)

Data type of the element

prec

INTEGER

Precision of the data type of the element

scale

INTEGER

Scale of the data type of the element

code_set

INTEGER

Character set if the data type of the element is a character

domain_class_name

VARCHAR(255)

Domain class name if the data type of the element is an object

Definition

CREATE VCLASS db_attr_setdomain_elm (
attr_name, class_name, attr_type,data_type, prec, scale, code_set, domain_class_name)
AS
SELECT a.attr_name, c.class_name,
       CASE WHEN a.attr_type = 0 THEN 'INSTANCE'
            WHEN a.attr_type = 1 THEN 'CLASS'
            ELSE 'SHARED' END,
       et.type_name, e.prec, e.scale, e.code_set, e.class_of.class_name
FROM _db_class c, _db_attribute a, _db_domain d,
      TABLE(d.set_domains) AS t(e), _db_data_type et
WHERE a.class_of = c AND d.object_of = a AND e.data_type = et.type_id AND
        (CURRENT_USER = 'DBA' OR
        {c.owner.name} subseteq (
                SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})
                from db_user u, table(groups) as t(g)
                where u.name = CURRENT_USER ) OR
        {c} subseteq (
SELECT sum(set{au.class_of})
                FROM _db_auth au
                WHERE {au.grantee.name} subseteq (
                            SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})
                            from db_user u, table(groups) as t(g)
                            where u.name = CURRENT_USER ) AND
                                    au.auth_type = 'SELECT')); 

If the set_attr attribute of class D is of a SET (A, B, C) type, the following three records exist.

Attr_name

Class_name

Attr_type

Data_type

prec

Scale

Code_set

Domain_class_name

‘set_attr’

‘D’

‘INSTANCE’

‘SET’

0

0

0

‘A’

‘set_attr’

‘D’

‘INSTANCE’

‘SET’

0

0

0

‘B’

‘set_attr’

‘D’

‘INSTANCE’

‘SET’

0

0

0

‘C’

Example

The following is an example of retrieving set type attributes and data types of the ‘city’ class. (The city table defined in Containment Operators is created.)

csql> select attr_name, attr_type, data_type, domain_class_name
csql> from db_attr_setdomain_elm
csql> where class_name = 'city';
csql> ;xrun

=== <Result of SELECT Command in Line 1> ===
 
attr_name             attr_type             data_type             domain_class_name
==============================================================================
 
'sports'              'INSTANCE'            'STRING'              NULL