Pular para conteúdo

Home

Buscar colunas no DB2

Buscar nomes das colunas no DB2
--for DB2/z
    select * from sysibm.systables
    where owner = 'SCHEMA'
    and name like '%CUR%'
    and type = 'T';

--for DB2/LUW
    select * from sysibm.systables
    where CREATOR = 'SCHEMA'
    and name like '%CUR%'
    and type = 'T';

Buscar colunas no vcolumn

Buscar nomes das colunas com vcolumn
1
2
3
4
5
6
7
8
9
proc sql;
create table COLUNAS_SUMARIZAR as 
select name as coluna, 'SUM' as tipo 
from sashelp.vcolumn 
where libname = 'WORK'
  and memname = 'CARTEIRAS'
  and name not in ('cd_depe', 'nr_ctra', 'posicao')
;
quit;