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 | 

cci_schema_info

Description

This function is used to get schema information. If it is performed successfully, the results are managed by the request handle and can be fetched by fetch and getdata. If you want to retrieve a class_name of attr_name by pattern matching, configure the flag.

Two flags, CCI_CLASS_NAME_PATTERN_MATCH and CCI_ATTR_NAME_PATTERN_MATCH, are used for pattern matching. You can configure these two flags by using the OR operator ( | ). Performance may significantly decrease if pattern matching is used.

The following table shows records composition of each type.

Record Composition of Each Type

Type

Column Order

Column Name

Column Type

CCI_SCH_CLASS

1

NAME

char*

2

TYPE

short
0 : system class
1 : vclass
2 : class
3 : proxy

CCI_SCH_VCLASS

1

NAME

char*

2

TYPE

short
1 : vclass
3 : proxy

CCI_SCH_ATTRIBUTE

1

NAME

char*

2

DOMAIN

int

3

SCALE

int

4

PRECISION

int

5

INDEXED

int
1 : indexed

6

NON_NULL

int
1 : non null

7

SHARED

int
1 : shared

8

UNIQUE

int
1 : unique

9

DEFAULT

void*

10

ATTR_ORDER

int
base : 1

11

CLASS_NAME

char*

12

SOURCE_CLASS

char*

13

IS_KEY

short
1 : key

CCI_SCH_CLASS_METHOD

1

NAME

char*

2

RET_DOMAIN

int

3

ARG_DOMAIN

char*

CCI_SCH_METHOD_FILE

1

METHOD_FILE

char*

CCI_SCH_super class

1

CLASS_NAME

char*

2

TYPE

short

CCI_SCH_SUBCLASS

1

CLASS_NAME

char*

2

TYPE

short

CCI_SCH_CONSTRAINT

1

TYPE
0 : unique
1 : index
2 : reverse unique
3 : reverse index

int

2

NAME

char*

3

ATTR_NAME

char*

4

NUM_PAGES

int

5

NUM_KEYS

int

6

PRIMARY_KEY
1 : primary key

short

7

KEY_ORDER

short
base : 1

CCI_SCH_TRIGGER

1

NAME

char*

2

STATUS

char*

3

EVENT

char*

4

TARGET_CLASS

char*

5

TARGET_ATTR

char*

6

ACTION_TIME

char*

7

ACTION

char*

8

PRIORITY

float

9

CONDITION_TIME

char*

10

CONDITION

char*

CCI_SCH_CLASS_PRIVILEGE

1

CLASS_NAME

char*

2

PRIVELEGE

char*

3

GRANTABLE

char*

CCI_SCH_ATTR_PRIVILEGE

1

ATTR_NAME

char*

2

PRIVILEGE

char*

3

GRANTABLE

char*

CCI_SCH_PRIMARY_KEY

1

CLASS_NAME

char*

2

ATTR_NAME

char*

3

KEY_SEQ

short
base : 1

4

KEY_NAME

char*

CCI_SCH_IMPORTED_KEY
Used to retrieve primary key columns that are referred by a foreign key column in a given table. The results are sorted by PKTABLE_NAME and KEY_SEQ.
If this type is specified as a parameter, a foreign key table is specified for class_name, and NULL is specified for attr_name.

1

PKTABLE_NAME

char**

2

PKCOLUMN_NAME

char**

3

FKTABLE_NAME

char**

4

FKCOLUMN_NAME

char**

5

KEY_SEQ

char**

6

UPDATE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

7

DELETE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

8

FK_NAME

char**

9

PK_NAME

char**

CCI_SCH_EXPORTED_KEYS
Used to retrieve primary key columns that are referred by all foreign key columns. The results are sorted by FKTABLE_NAME and KEY_SEQ.
If this type is specified as a parameter, a primary key table is specified for class_name, and NULL is specified for attr_name.

1

PKTABLE_NAME

char**

2

PKCOLUMN_NAME

char**

3

FKTABLE_NAME

char**

4

FKCOLUMN_NAME

char**

5

KEY_SEQ

char**

6

UPDATE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

7

DELETE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

8

FK_NAME

char**

9

PK_NAME

char**

CCI_SCH_CROSS_REFERENCE
Used to retrieve foreign key information when primary keys and foreign keys in a given table are cross referenced. The results are sorted by FKTABLE_NAME and KEY_SEQ.
If this type is specified as a parameter, a primary key is specified for class_name, and a foreign key table is specified for attr_name.

1

PKTABLE_NAME

char**

2

PKCOLUMN_NAME

char**

3

FKTABLE_NAME

char**

4

FKCOLUMN_NAME

char**

5

KEY_SEQ

char**

6

UPDATE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

7

DELETE_ACTION
-cascade=0
-restrict=1
-no action=2
-set null=3

Int*

8

FK_NAME

char**

9

PK_NAME

char**

Pattern match

CCI_SCH_TYPE

Class name

ATTR_name

CCI_SCH_CLASS (VCLASS)

O

none

CCI_SCH_ATTRIBUTE (CLASS ATTRIBUTE)

O

O

CCI_SCH_CLASS_PRIVILEGE

O

none

CCI_SCH_ATTR_PRIVILEGE

X

O

CCI_SCH_PRIMARY_KEY

O

none

If the pattern flag is not configured, exact string matching is used for the given class or attribute name. Therefore, there is no result if NULL is given. If the name of the class or attribute is NULL when the pattern flag is configured, the result is the same as when "%" is used.

Note TYPE column of CCI_SCH_CLASS and CCI_SCH_VCLASS : The proxy type is added. When used in OLEDB, ODBC or PHP, vclass is represented without distinguishing between proxy and vclass.

Syntax

int cci_schema_info(int conn_handle, T_CCI_SCHEMA_TYPE type, char *class_name, char *attr_name, char flag, T_CCI_ERROR *err_buf)

  • conn_handle : (IN) Connection handle
  • type : (IN) Schema type
  • class_name : (IN) Class name or NULL
  • attr_name : (IN) Attribute name of NULL
  • flag : (IN) Pattern matching flag (CCI_CLASS_NAME_PATTERN_MACTH or CCI_CLASS_NAME_PATTERN_MATCH)
  • err_buf : (OUT) Database error buffer
Return Value
  • Success : Request handle
  • Failure : Error code
Error Code
  • CCI_ER_CON_HANDLE
  • CCI_ER_DBMS
  • CCI_ER_COMMUNICATION
  • CCI_ER_SCHEMA_TYPE
  • CCI_ER_NO_MORE_MEMORY
  • CCI_ER_CONNECT