Oracle

Column Information

Figo Kim 2006. 11. 27. 21:23
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
While the USER_TABLES view provides information on your table names and storage, USER_TAB_COLUMNS is used to obtain detailed information of each column of a table.
- Column names,
- Column data types
- Length of data types
- Precision and scale for NUMBER columns
- Whether null are allowed
- Default value.

DESCRIBE user_tab_columns;

Name Null? Type
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
DATA_TYPE   VARCHAR2(106)
DATA_TYPE_MOD   VARCHAR2(3)
DATA_TYPE_OWNER   VARCHAR2(30)
DATA_LENGTH NOT NULL NUMBER
DATA_PRECISION   NUMBER
DATA_SCALE   NUMBER
NULLABLE   VARCHAR2(1)
COLUMN_ID   NUMBER
................more..

SELECT column_name, data_type, data_length, data_precision, data_scale, nullable
FROM user_tab_columns WHERE table_name = 'EMPLOYEES';

COLUMN_NAME DATA_TYPE DATA_LENGTH DATA_PRECISION DATA_SCALE NUL
EMPLOYEE_ID NUMBER 22 6 0 N
FIRST_NAME VARCHAR2 20     Y
LAST_NAME VARCHAR2 25     N
EMAIL VARCHAR2 25     N
PHONE_NUMBER VARCHAR2 20     Y
HIRE_DATE DATE 7     N
JOB_ID VARCHAR2 10     N
SALARY NUMBER 22 8 2 Y
COMMISSION_PCT NUMBER 22 2 2 Y
MANAGER_ID NUMBER 22 6 0 Y
DEPARTMENT_ID NUMBER 22 4 0 Y

11 rows selected.


'Oracle' 카테고리의 다른 글

Constraint Information (table level)  (0) 2006.11.27
Column Information  (0) 2006.11.27
Table Information  (0) 2006.11.27
Table Information  (0) 2006.11.27
How to use the Dictionary Views  (0) 2006.11.27