Subject Re: [ib-support] Metadata SP order extraction problem
Author Kubanych Tajmamat uloo
Dear Mr. Marco Menardi

>Hi, I've always extracted metadata (with IB_Manager or IB_SQL),
>modified and rebuild the database.
>Now that I've add other more SP in my database, I can't rebuild
>because the order in wich metatata is extracted makes a SP being
>created before another SP that it calls (i.e. A calls B, and A is
>created before B, so it does not found the B reference).
>If I rearrange the SP order and build the database, next time I
>extract and rebuild I have the same problem.
>Is there a way to extract the SP in "creation" order? How can I avoid
>this?
>
>
for building and rebuilding databases using isql I have got a small tool.
Separate script types
t1) domains, tables, udfs, generators
t2) procedure and user trigger droppers
t3) procedures and user triggers
t4) data
are located at separate files (script templates) with specified type at
directory tree.
The tool scans the tree from starting directory and collects script
templates into sql script.
In (t1,t3,t4) order it creates a script to build database.
In (t2,t3) order it creates a script to rebuild database: drop and build
procedures and
user triggers.
For dropping procedures and user triggers there is one utility written
in c+GPRE
(could be compiled under borland c55 and gcc) which scans system tables
and creates t2 type script template (for dropping)

After writing it I forgot the problem of creation order of procedures
and triggers.
Sql scripts now could be separated into modules like units in pascal.

The tool was written with free pascal, now it is used on win32, but could be
compiled by POSIX ports of free pascal (linux, etc).

The tool was designed to work with multiple databases and could be used
for single database.

I use it only for my own projects but if it is interesting for the
folks, it is
possible to place the tool at ibphoenix for freeware like based_on (
http://www.ibphoenix.com/downloads/basedon.zip ).

Best regards,
Kubanychbek Tajmamat uloo.