Google
 

Kamis, 20 September 2007

Firebird System Tables (Part III)

This article idea (Part III) is belong to the someone that put comment on my previous article, so I just accomodate his/her idea. And I already arrange to become a view like this:

CREATE VIEW "vSYS_FindDependencies"(
"dependentName",
"dependentType",
"dependedOnName",
"dependedOnFieldName",
"dependedOnType")
AS
select RDB$DEPENDENT_NAME,
case RDB$DEPENDENT_TYPE
when 0 then 'Table'
when 1 then 'View'
when 2 then 'Trigger'
when 3 then 'Computed field'
when 4 then 'Validation'
when 5 then 'Procedure'
when 6 then 'Expression index'
when 7 then 'Exception'
when 8 then 'User'
when 9 then 'Field'
when 10 then 'Index'
when 14 then 'Generator'
else RDB$DEPENDENT_TYPE
end DEPENDENT_TYPE,
RDB$DEPENDED_ON_NAME, RDB$FIELD_NAME,
case RDB$DEPENDED_ON_TYPE
when 0 then 'Table'
when 1 then 'View'
when 2 then 'Trigger'
when 3 then 'Computed field'
when 4 then 'Validation'
when 5 then 'Procedure'
when 6 then 'Expression index'
when 7 then 'Exception'
when 8 then 'User'
when 9 then 'Field'
when 10 then 'Index'
when 14 then 'Generator'
else RDB$DEPENDED_ON_TYPE
end DEPENDED_ON_TYPE
from RDB$DEPENDENCIES;

The idea is to know the dependency on some entity in the database. Perhaps it is also usefull for everyone.

2 komentar:

Romkin mengatakan...

Basically right.
I wrote type codes directly from old language reference, 1 through 10. In new systems 14 are really for generator. But what for another codes? ;-)
All codes for dependencies described in RDB$TYPES. Basic query is
select RDB$TYPE, RDB$TYPE_NAME from RDB$TYPES where RDB$FIELD_NAME = 'RDB$OBJECT_TYPE'
If you join this into view, all possible types will be described automatically without 'case'.
RDB$TYPES also contains another descriptions, 'RDB$FIELD_TYPE' codes, for example. You may use it for description of RDB$FIELDS.RDB$FIELD_TYPE.

Anonim mengatakan...

Bonjorno, firebird-with-delphi.blogspot.com!
effetto gi? dopo 30 minuti. [url=http://farmamed.fora.pl/ ]Dove Compra cialis in Italia[/url] Treatment of erectile dysfunction. In order for Cialis to be effective, sexual [url=http://farmitalia.fora.pl/ ]Come Comprare cialis in Italia[/url] i1101z vendita cialis generico. From: brongespeense. Category: General [url=http://milanofarma.fora.pl/ ]Dove Comprare cialis generico[/url] zealand. purchase cialis. cialis generica. cialis basso dosaggio. cialis [url=http://farmanova.fora.pl/ ] Comprare cialis generico[/url] ? comunemente chiamato Cialis. In alcuni pazienti che assumono il farmaco, dopo [url=http://farmaroma.fora.pl/ ] Compra cialis generico[/url]