9 SQL Conversion
Aubit4GL allows you to connect to DBMSes (database management systems) from various vendors, as long the connection is via the SQL command language. Unfortunately, the syntax of the SQL language can differ considerably from one vendor to another, and often valid syntax for one DBMS fails when executed against some other DBMS. One way around this is to maintain different versions of your application, eg. one for use with Informix, another for running against Oracle, another for PostgreSQL, and so on. Another way is to replace each SQL command in your source code with a number of alternatives in a case statement, depending on the target database type. Either way, your code will be difficult to maintain and harder to read.
Aubit4GL resolves this by providing a module that lets you write code using just one version or "dialect" of SQL, and have this converted into the correct form for whatever database you connect to at run-time.
In order to do this, Aubit4GL needs to know the following:
-
the source SQL dialect that your source code is written in
-
the target SQL dialect expected by the currently connected DBMS
-
rules on how to convert SQL commands between source and target forms.