with INFO as (
select 'INMUN2018' as username
, 'TB_CODE' as usertable
from dual
),
PK as (
select c.column_name
, case when a.constraint_type = 'R' then 'Y' else '' end as column_fk
from sys.user_cons_columns c,
sys.user_constraints a,
INFO u
where a.owner = c.owner
and a.table_name = c.table_name
and a.constraint_name = c.constraint_name
and a.constraint_type in ('P', 'R')
and a.table_name = u.usertable
and a.OWNER = u.username
)
select PK
, FK
, column_name
, data_type
, data_type || '(' || data_length || ')'
, data_length
, nullable
, data_default
, comments
from (
SELECT case when length(p.column_name) > 0 then 'PK' else ' ' end as PK
, p.column_fk as FK
, c.column_name
, c.data_type
, case
when c.data_type = 'VARCHAR2' then to_char(data_length)
when c.data_type = 'DATE' or c.data_type = 'FLOAT' or c.data_type = 'INTEGER' or
c.data_type = 'BLOB' then ''
when c.data_type = 'NUMBER' then (case
when data_precision is null then ''
when data_scale = 0 then to_char(data_precision)
else to_char(data_precision) || ',' || to_char(data_scale) end
)
else (case
when data_precision is null then ''
when data_scale = 0 then to_char(data_precision)
else to_char(data_precision) || ',' || to_char(data_scale) end
) end as data_length
, c.COLUMN_ID
, c.NULLABLE
, c.data_default
, s.comments
FROM USER_TAB_COLUMNS c,
PK p,
INFO u,
USER_COL_COMMENTS s
WHERE c.TABLE_NAME = u.usertable
and c.column_name = p.column_name(+)
and c.table_name = s.table_name
and c.COLUMN_NAME = s.column_name
)
order by column_id;사업자 정보 표시
디알소프트 | 유용훈 | 서울시 양천구 오목로 30길 | 사업자 등록번호 : 184-47-00657 | TEL : 02-2692-1002 | Mail : gkioo@daum.net | 통신판매신고번호 : 호 | 사이버몰의 이용약관 바로가기
'Programming > 기본 (Baisc)' 카테고리의 다른 글
| [MariaDB] [RDBMS] MariaDB Index 3072 bytes (0) | 2022.01.31 |
|---|---|
| [AWS 이관][AWS Migration] 카페24 Cafe24 to Amazon AWS EC2 (0) | 2022.01.20 |
| [DB] [Oracle] 오라클 계층 쿼리 (0) | 2022.01.03 |
| [CSS][Animate][style] 역동적인 애니메이션 효과 플러그인 (0) | 2021.12.10 |
| [GIt][깃랩][Gitlab] 대용량 파일 Push Commit 방법 (0) | 2021.12.06 |