A dependency file can be used to specify some or all of the foreign key dependencies between tables. Dependencies between a table and itself are ignored by Sqlch.
If used on its own, a dependency file provides better performance performance due to the reduction in round-trips to the database. In most cases performance is not a good enough reason to choose to use a dependency file since developers must maintain the file along with the schema.
The main reason to use a dependency file is for situations where the JDBC driver you are using is broken in some way and the information retrieved from the JDBC driver cannot be relied upon or causes Sqlch to fail. The dependency file can be used as either an alternative from the dependencies reported by the database or to provide additional dependency information.
It is possible to generate a dependency file from a database that has had the appropriate DDL loaded already. This can be used to check the dependencies that Sqlch is aware of and therefore may be used to help debug dependencies issues. See this page for more information.
See the page on support tools for more information on Sqlch tools.
NOTE:The table identifiers used in the dependencies file are as described on the table identifiers page. Read this before creating your own dependency file.
The dependency file is an XML file. References in the dependencies file are only allowed to tables also defined in the dependency file (even for those tables that don't have dependencies).
Example:
This example shows definitions for three tables. The DEMO_DEPENDENT_TABLE is dependent on two sub-tables, one of which (DEMO_DEPENDENCY_TABLE2) is dependent on the other.
<dependencies> <table schema="DEMO_SCHEMA" name="DEMO_DEPENDENT_TABLE"> <dependsOn schema="DEMO_SCHEMA" name="DEMO_DEPENDENCY_TABLE1"/> <dependsOn schema="DEMO_SCHEMA" name="DEMO_DEPENDENCY_TABLE2"/> </table> <table schema="DEMO_SCHEMA" name="DEMO_DEPENDENCY_TABLE1"/> <table schema="DEMO_SCHEMA" name="DEMO_DEPENDENCY_TABLE2"> <dependsOn schema="DEMO_SCHEMA" name="DEMO_DEPENDENCY_TABLE2"/> </table> </dependencies>
The order of the definitions of the tables within the file is not important.
Sqlch SourceForge Distribution: 0.1Alpha8 20041026 2208