Firebird 获取用户表及字段

时间:2021-10-08 14:55:16
select
rdb$relation_fields.rdb$relation_name table_name,
rdb$relations.rdb$description table_des,
rdb$relation_fields.rdb$field_name field_name,
rdb$relation_fields.rdb$description field_des,
rdb$types.rdb$type_name field_type,
rdb$relation_fields.rdb$field_position seq,
rdb$relation_fields.rdb$null_flag not_null,
rdb$fields.rdb$null_flag domain_not_null,
rdb$fields.RDB$FIELD_PRECISION precis,
rdb$fields.rdb$field_scale scale
from rdb$types
inner join rdb$fields on (rdb$types.rdb$type = rdb$fields.rdb$field_type)
inner join rdb$relation_fields on (rdb$fields.rdb$field_name = rdb$relation_fields.rdb$field_source)
inner join rdb$relations on (rdb$relation_fields.rdb$relation_name = rdb$relations.rdb$relation_name)
where rdb$relation_fields.rdb$system_flag = 0 and rdb$types.rdb$field_name = 'RDB$FIELD_TYPE'
order by rdb$relation_fields.rdb$relation_name, rdb$relation_fields.rdb$field_position