SQL translation from non-Mimer SQL
The SQL translator program provides the functionality for translating non-Mimer SQL statements to valid Mimer SQL. The tool can be used to translate database definition scripts as well as embedded SQL or module SQL scripts.
SQLTRANSLATOR - Translating SQL
The input to the translator is an SQL script, embedded SQL source code or an SQL module written for a non-Mimer SQL vendor. It is given in an input file.
The output file from the translator contains the SQL script, embedded SQL source code or an SQL module, with the SQL statements translated to Mimer SQL.
The original SQL statements are retained as comments in the output file, as well as translation information for every statement.
The default file extensions for translator input and output files depend on the input origin and translation mode, and are shown in the table below:
|
Vendor |
Mode |
Input file extension |
Output file extension |
|---|---|---|---|
|
Oracle RDB |
SQL script |
.sql |
mimer_*.sql |
|
Oracle RDB |
Embedded SQL for C |
.sc |
.ec |
|
Oracle RDB |
Embedded SQL for COBOL |
.sco |
.eco |
|
Oracle RDB |
Embedded SQL for Fortran |
.sfo |
.efo |
|
Oracle RDB |
Module SQL |
.sqlmod |
.msq |
sqltranslator is controlled by the following command-line parameters:
sqltranslator [-n] [--rdb] [-s|-c|-b|-f|-m] [-j]
[--latin1|--utf8|--utf16] [-r fixed|terminal] input [outfile]
sqltranslator [--nologo] [--rdb] [--script|--c|--cobol|--fortran|--module]
[--json] [--latin1|--utf8|--utf16] [--format=fixed|terminal]
input [outfile]
sqltranslator -? | --help
Command-line Arguments
|
Unix-style |
VMS-style |
Function |
|
-n --nologo |
/NOLOGO |
Omit company information from output. |
|
--rdb |
/RDB |
Indicates that the input SQL syntax is written for Oracle RDB |
|
-s --script |
/SCRIPT |
Translate an SQL script. This is the default – if none of the switches script, c, cobol, fortran or module are given, script is used. |
|
-c --c |
/C |
Translate embedded C code. |
|
-b --cobol |
/COBOL |
Translate embedded COBOL code. |
|
-f --fortran |
/FORTRAN |
Translate embedded Fortran code. |
|
-m --module |
/MODULE |
Translate module SQL code. |
|
-j --json |
/JSON |
Produces JSON format output to output file. |
|
--latin1 |
/LATIN1 |
Reads input file and writes output file in the Latin-1 (ISO-8859-1) encoding. |
|
--utf8 |
/UTF8 |
Reads input file and writes output file in the UTF-8 encoding. |
|
--utf16 |
/UTF16 |
Reads input file and writes output file in the UTF-16 encoding. |
|
-r option --format=option |
/FORMAT=option |
The language format of the input file. Use this qualifier together with COBOL. /FORMAT=FIXED The COBOL program uses ANSI format. If compiling with VSI COBOL, use COBOL/ANSI to compile.
/FORMAT=TERMINAL The COBOL program uses VSI terminal format. If compiling with VSI COBOL, use COBOL/NOANSI (which is default) to compile. If omitted, format FIXED is default. |
|
input |
input |
The input file containing the source code to be translated. If no file extension is specified, the appropriate file extension for the source mode is assumed (previously described in this section.) |
|
outfile |
outfile |
The output file which will contain the Mimer SQL statements generated by the translator. If not specified, the output file will have the same name as the input file, but with the appropriate default output file extension (previously described in this section.) |