Select columns information in interbase
I need to selec开发者_如何学JAVAt all columns of my database and their properties
(default, comment, type, Precision, Scale, if primary Key, nullable and auto increment).What command do I use for this?
SELECT rdb$field_name, rel_field.rdb$field_name,
rdb$field_type, rdb$field_sub_type,
rel_field.rdb$null_flag, rdb$field_length, rdb$field_scale,
rdb$character_length, rdb$field_precision,
field.rdb$default_source, field.rdb$validation_source
FROM rdb$relations rel
JOIN rdb$relation_fields rel_field
ON rel_field.rdb$relation_name = rel.rdb$relation_name
JOIN rdb$fields field
ON rel_field.rdb$field_source = field.rdb$field_name
WHERE rel.rdb$relation_name = : RelationName <<---- insert tablename here
ORDER BY rel_field.rdb$field_position, rel_field.rdb$field_name
See this page for more info:
http://www.felix-colibri.com/papers/db/interbase/using_interbase_system_tables/using_interbase_system_tables.html
精彩评论