[firebase-br] Como capturar relacionamentos no firebird
Gamarra
francisco.gamarra em gmail.com
Seg Jul 31 16:59:13 -03 2006
create view ForeignKey (TableA, Campo, TableB, OnUpdate, OnDelete)
as
select
a.rdb$relation_name,
c.rdb$relation_name,
d.rdb$field_name,
b.rdb$update_rule,
b.rdb$delete_rule
from
rdb$relation_constraints a,
rdb$ref_constraints b,
rdb$relation_constraints c,
rdb$index_segments d
where
a.rdb$constraint_type = 'FOREIGN KEY'
and a.rdb$constraint_name = b.rdb$constraint_name
and b.rdb$const_name_uq = c.rdb$constraint_name
and a.rdb$index_name = d.rdb$index_name;
select *
from ForeignKey
order by TableA, Campo
Mais detalhes sobre a lista de discussão lista