If you would like the Oracle version of this page, please click here.
The diagram on the right shows the interaction of the software components, both DP4 and non-DP4 when using the ODBC Gateway ADC.
As with all schemes in which an Auxiliary Database Controller (ADC) is utilised, the logic of the application is separated from the logic of server selection; the DP4 application is unaware that it is accessing information from other than a local DP4 database. When the application wants to access the database it makes its requests of the local DP4 database manager, SRVW or DP4SRVR.W32. A separate program, the DP4 ODBC gateway ADC, intercepts the database accesses, creates SQL statements and directs them to the ODBC driver program. Typically provided by the foreign database vendor, the ODBC driver is analogous to the DP4 database manager and accesses data from its associated ODBC data source. An ODBC data source includes the data the application wants to access and the information needed to get to that data. Two examples of data sources are: an SQL server database, the server on which it resides and the network used to access that server; a directory containing a set of dBASE files.
A DP4 database must also be present for each ODBC data source that is to be accessed. While the DP4 database does not hold any data, it must have the same table and field definitions as its associated ODBC data source. The reason for this is that the ODBC data source may have an incompatible data dictionary, and so the structure information for fields and tables is always taken from the base dictionary of the DP4 database. You may wonder how DP4 determines that base dictionary tables should be accessed on the DP4, rather than the foreign, database. This is due to the DP4 "local/remote" mechanism. That is, when the ODBC gateway is loaded, base dictionary tables are, by default, marked as local and fetched from the DP4 database and application tables containing data are, by default, marked as remote, and fetched from the ODBC data source. This can be overridden by use of entries in the DP4 Configuration file.
The ODBC gateway ADC constructs SQL statements, for accessing the ODBC data source, based on DP4 table names and fieldnames.As you might expect, some of the names on the DP4 database may be invalid on the ODBC data source and the converse is also true. To cater for this, you can define a translation table that converts from one set of names to the other.
It should be noted that the generated SQL statements are constructed purely as a translation of the DP4 function being requested. The Gateway ADC has no knowledge of what the application is trying to do. This means that the SQL generated may not be optimal. For example the Gateway ADC has no knowledge of the constraints the application may be using to filter the records it is fetching. Thus a bigger result set may be generated than is required. A particular problem is there is no way in SQL of fetching records one at a time. This means that many operations which are very efficient on a DP4 database are inefficient against a SQL database. Problems are likely to show up particularly on large databases. See Implementation Details for more information.