Subject Re: [ib-support] Extracting Table Creation declarations
Author Entrebytes S.L.
(Really , I'm feeling that I'm monopolizing your time today...)

Of course , i did pass throgth the IB documentation to peek the system
tables , and now , i have a tool that extract and compares Stored Procedures
, Triggers and name tables. Indeed , i could "reconstruct" the declaration
from the data i can gather from the RDB$RELATIONS & friends. What i was
asking (And now , i see there is not) was if there is some blob field that
store the actual table definition , like the ones that store the text (not
the BLR , thank you) definition of Triggers and Procedures.

Well.. seems there is time to get the hands dirty of bits and work some
constructor from the data i have by now..

The point you had made about documentation errors had me scared to the
n-point .... i'll scan more carefully now. Many many thanks.


Javi
EntreBytes S.L.
Ontenient , Spain
ERP Development.
----- Original Message -----
From: "Martijn Tonies" <martijn@...>
To: <ib-support@yahoogroups.com>
Sent: Wednesday, April 03, 2002 2:11 PM
Subject: RE: [ib-support] Extracting Table Creation declarations


> Hi,
>
> well, if you don't care using 3rd party (non-free) tools, you might want
> to take a look at InterBase Workbench - as other tools, it has a
> 'statement
> recorder' with which you can record your DDL changes.
>
> As for a meta data extract, the IB/FB metadata tables are quite a
> mess...
>
> Sometimes IB itself doesn't know what to show (especially for IB 5.x,
> IB6
> is a bit better).
>
> Then, there's the issue with, for example, triggers - they can be found
> in the RDB$TRIGGERS table. But some triggers are system defined to take
> care of foreign key references, check constraints and more... Claudio
> changed a couple of things for FB1 so that it's easier to recognize
> system
> defined triggers, but this will only work if you're creating your DB
> from
> scratch with FB1...
>
> Take a look at the Language Reference, chapter SYSTEM TABLES AND VIEWS.
> And learn to look through the documentation errors...
>
> RDB$RELATIONS == lists tables and views
> RDB$RELATION_FIELDS== lists the columns for a table or view and the
> (domain) source
> RDB$FIELDS == lists the domains, either user defined or system
> defined
> RDB$GENERATORS == lists all generators
> RDB$TRIGGERS == lists triggers
> RDB$INDICES == lists indices
> RDB$INDEX_SEGMENTS == lists indexed columns
> RDB$RELATION_CONSTRAINTS == lists basic constraint info, together with
> several other tables (RDB$CHECK_CONSTRAINTS for example) it lists the
> full constraint info. For PKs, use RDB$INDEX_SEGMENTS to get what fields
>
> are constrained. For FKs, use RDB$REF_CONSTRAINTS to know to what
> constraint the FK is pointing, then, use the RDB$INDEX_SEGMENTS and
> RDB$CONSTRAINTS table to get what fields are in use by that constraint.
>
> And there are several more...
>
>
> Good luck :)
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
>
>
>
> In fact , what i'm trying to do is life easier.
> Seriusly , to mantain consistency between the central (development)
> database
> and the installed (production) ones , so if I alter tables in the
> development database , I could do a comparation between ddl's of both
> databases online and make some sort of operation that mantains
> consistency
> betewen the client software and the database. Is far more complicated
> that
> this , of course , but you could see the general idea. A sort of "poor
> man
> database replication"
>
> And i really appreciate to know what's going on , so a component that
> comes
> without the source code to poke arround , since it could be really
> usefull
> (i'm taking a deep interest in IBO , but I'm open to suggestions , of
> course) , is not what i really like.
>
> Thanks for your interest.
>
> Javi
> EntreBytes S.L.
> Ontenient , Spain
> ERP Development.
>
> To: <ib-support@yahoogroups.com>
> Sent: Wednesday, April 03, 2002 1:43 PM
> Subject: RE: [ib-support] Extracting Table Creation declarations
>
>
> > Hi,
> >
> > Almost all system tables :)
> >
> > It's not as easy at it looks... You might want to use one of the
> > ready-made solutions. Both IBExpress and IBObjects have a meta data
> > extract component, I guess FIBPlus has one too.
> >
> > What are you trying to do, perhaps there's another way?
> >
> > Martijn Tonies
> > InterBase Workbench - the developer tool for InterBase and Firebird
> > http://www.interbaseworkbench.com
> >
> >
> >
> > Could someone tell me what system table i should query to ascern
> > the code for creation of the user tables ? Sort of a extract database
> in
> > isql , but by delphi code / sql query.
> >
> >
> > Javi
> > EntreBytes S.L.
> > Ontenient , Spain
> > ERP Development.
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>