postgresql 도멘인 넣기. 컬럼 사이즈등등
insert into tb_cm_domain ( domain_nm, domain_cd, data_type, rmk, crt_dtm ) select domain_nm, domain_cd, data_type, ARRAY_TO_STRING(ARRAY_AGG(table_name ORDER BY table_name),',') rmk, now() from ( select b.description domain_nm ,a.column_name domain_cd ,a.data_type || case when character_maximum_length is not null then '('||character_maximum_length||')' else '' end as data_type ,a.table_name --,a..
postgresql ==> ARRAY_TO_STRING(ARRAY_AGG(컬러명 ORDER BY 컬럼명), ',') 컴마 연결 오라클 LIST_AGG 같은거.
insert into tb_cm_domain ( domain_nm, domain_cd, data_type, rmk, crt_dtm ) select domain_nm, domain_cd, data_type, ARRAY_TO_STRING(ARRAY_AGG(table_name ORDER BY table_name),',') rmk, now() from ( select b.description domain_nm ,a.column_name domain_cd ,a.data_type || case when character_maximum_length is not null then '('||character_maximum_length||')' else '' end as data_type ,a.table_name --,a..