下面只是调取 表和视图的字段信息,还有很多 官方视图,也很有用,这个要对个 EN文档看了
路径:HANA->Catalog->SYS->Views
--元数据查询
select
COLUMN_NAME "字段名",
DATA_TYPE_NAME "字段类型",
"LENGTH" "字段长度",
SCALE "小数位",
COMMENTS "字段描述"
from "SYS"."VIEW_COLUMNS" where VIEW_NAME like '%PrinxSAPBI.AL/PGC_XSZX_A001'
order by "POSITION"
--脚本视图 元数据描述
select distinct COLUMN_NAME,COLUMN_CAPTION from "_SYS_BI"."BIMC_DIMENSION_VIEW" where DESC_OBJECT_NAME like '%PrinxSAPBI.AL/PSC_XSZX_A002%'
--合并查询
select
a.COLUMN_NAME "字段名",
a.DATA_TYPE_NAME "字段类型",
a."LENGTH" "字段长度",
a.SCALE "小数位",
ifnull(a.COMMENTS,b.COLUMN_CAPTION) "字段描述"
from "SYS"."VIEW_COLUMNS" a
left join (select distinct COLUMN_NAME,COLUMN_CAPTION from "_SYS_BI"."BIMC_DIMENSION_VIEW"
where DESC_OBJECT_NAME like '%PrinxSAPBI.AL/PSC_XSZX_A002%') b on a.COLUMN_NAME = b.COLUMN_NAME
where VIEW_NAME like '%PrinxSAPBI.AL/PSC_XSZX_A002'
order by "POSITION"