Google
 

Rabu, 26 September 2007

Firebird System Tables (Part III rev 1)

Here is some revision (from Romkin idea) to the query of Firebird System Tables part III.
In this query, it doesn't need anymore to has "case" statement to get the convertion from numeric type_name to more readable name. And I want to say thank you for the supporting comment on this little articles. Once correction from Milan Babuskov that told me "CONTAINING" is in Firebird since the first versions 1.0. Hope all articles in this blog can be usefull for FB community. Wait for the next Firebird System Tables again, stay tune on the same channel he..he..he.. :)

CREATE VIEW "vSYS_FindDependencies"(
"dependentName",
"dependentType",
"dependedOnName",
"dependedOnFieldName",
"dependedOnType")
AS
select d.RDB$DEPENDENT_NAME DEPENDENT_NAME,
(select t.RDB$TYPE_NAME from RDB$TYPES t
where d.RDB$DEPENDENT_TYPE=t.RDB$TYPE
and t.RDB$FIELD_NAME = 'RDB$OBJECT_TYPE'
) DEPENDENT_TYPE,
d.RDB$DEPENDED_ON_NAME DEPENDED_ON_NAME, d.RDB$FIELD_NAME DEPENDED_ON_FIELD_NAME,
(select t.RDB$TYPE_NAME from RDB$TYPES t
where d.RDB$DEPENDED_ON_TYPE=t.RDB$TYPE
and t.RDB$FIELD_NAME = 'RDB$OBJECT_TYPE'
) DEPENDED_ON_TYPE
from RDB$DEPENDENCIES d

Tidak ada komentar: