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_VCLASS

Represents SQL definition statements of virtual classes for which the current user has access authorization in the database.

Attribute Name

Data Type

Description

vclass_name

VARCHAR(255)

Virtual class name

vclass_def

VARCHAR(4096)

SQL definition statement of the virtual class

Definition

CREATE VCLASS db_vclass (vclass_name, vclass_def)

AS

SELECT q.class_of.class_name, q.spec

FROM _db_query_spec q

WHERE CURRENT_USER = 'DBA' OR

        {q.class_of.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

        {q.class_of} 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');

Example

The following is an example of retrieving SQL definition statements of the 'db_class’ virtual class.

csql> select vclass_def

csql> from db_vclass

csql> where vclass_name = 'db_class';

csql> ;xrun

 

=== <Result of SELECT Command in Line 1> ===

 

'SELECT c.class_name, CAST(c.owner.name AS VARCHAR(255)), CASE c.class_type WHEN 0 THEN 'CLASS' WHEN 1 THEN 'VCLASS' WHEN 2 THEN 'PROXY' ELSE 'UNKNOW' END, CASE WHEN MOD(c.is_system_class, 2) = 1 THEN 'YES' ELSE 'NO' END, CASE WHEN c.sub_classes IS NULL THEN 'NO' ELSE NVL((SELECT 'YES' FROM _db_partition p WHERE p.class_of = c and p.pname IS NULL), 'NO') END FROM _db_class c WHERE 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')'