Subject Re: [IB-Architect] SQL Statement Depandance Mapping
Author Daniel_Work@nemmco.com.au
Daniel_Work@... wrote:
>>
>> SQL Statement Dependency Mapping
>>
>> I had an idea for a tool / API extension for obtaining the schema
>> dependencies of a DML statement.

>In fact, I think it is possible to obtain the desired result (the list
>of dependants of a DML) with a few querys.
>Think that you can do a query like

DML: Data Manipulation Language (SELECT, UPDATE, DELETE) as opposed to DDL
(CREATE TABLE, etc)

>select * from rdb$dependencies where rdb$dependent="tablename"
>or
>select * from rdb$dependencies where rdb$dependent=" SP name "

>You can do a selectable SP that, having a SP name as parameter, extract
>all the dependencies, an can be recursive!

>So, I think there's no need for new API calls, just do some querys.

>Collecting the result of this SP to do a graph of dependencies, etc. is
>not an issue here, I think.

>Catch I your idea?

>Regards

>Adrián

I'm not really interested in dependencies between objects with in the
database (tables, SPs, etc). What I am interested in is the dependencies of
embedded or dynamic SQL (SELECT, UPDATE, DELETE). The query engine must
discover these dependencies the first time the statement is prepared. The
data from the query engine could be used to build dependency maps.



>
> My theory goes like this, Interbase's SQL query engine would already be
> able to determine tables, columns, etc that a statement requires for
> execution.
>
> If these requirements could some how be extracted and dumped into a file
> together with the requirements of other SQL statements an overall schema
> dependency map for an application could be built.
>
> For example I could see a Delphi expert scanning through the forms in a
> project extracting the SQL from queries for dependency mapping.
>
> Does this sound like a feasible/usefully idea?
>
> Would it be a new tool or an extra set of API calls?
>
> PS I haven't been following the list too closely so if this isn't a new
> idea please be kind ;-)