Was this helpful?
Command Line Operations
The following sections describe command line operations that you can use to turn your Embedded SQL/Fortran source program into an executable program. The commands to preprocess, compile, and link your program are also described in these sections.
esqlf Command – Invoke Embedded SQL Preprocessor for Fortran
The Fortran preprocessor is invoked by the following command line:
esqlf {flags} {filename}
where flags are
 
Flag
Description
-d
Adds debugging information to the runtime database error messages generated by Embedded SQL. The source file name, error number and the statement in error are printed with the error message.
-f[filename]
Writes preprocessor output to the named file. If you do not specify filename, the output is sent to standard output, one screen at a time.
-iN
Sets the default size of integers to N bytes. N must be either 2 or 4. The default is 4. If 2 is used, you must also use the -i2 compiler flag (Linux) or the /integer_size:16 compiler flag (Windows).
‑f90
Recognizes gfortran syntax for f90, and generates code using that syntax.
-l
Writes preprocessor error messages to the preprocessor's listing file, as well as to the terminal. The listing file includes preprocessor error messages and your source text in a file named filename.lis, where filename is the name of the input file.
-lo
Like -l, but the generated Fortran code also appears in the listing file.
-o
Directs the processor not to generate output files for include files. This flag does not affect the translated include statement in the main program. The preprocessor generates a default extension for the translated include file statements unless you use the -o.ext flag.
-o.ext
Specifies the extension given by the preprocessor to both the translated include statements in the main program and the generated output files. If this flag is not provided, the default extension is ".f" (Linux) or ".for" (Windows).
If you use this flag in combination with the -o flag, then the preprocessor generates the specified extension for the translated include statements, but does not generate new output files for the include statements.
-s
Reads input from standard input and generates Fortran code to standard output. This is useful for testing unfamiliar statements. If you specify the -l option with this flag, the listing file is called "stdin.lis." To terminate the interactive session, type Control-D (Linux) or Control-Z (Windows).
-sqlcode
-nosqlcode
Indicates the file declares an integer variable named SQLCODE to receive status information from SQL statements. That declaration need not be in an exec sql begin/end declare section. This feature is provided for ISO Entry SQL-92 conformity. However, the ISO Entry SQL92 specification describes SQLCODE as a "deprecated feature," and recommends using the SQLSTATE variable.
Tells the preprocessor not to assume the existence of a status variable named SQLCODE.
-w
Prints warning messages.
-wopen
This flag is identical to -wsql=open. However, -wopen is supported only for backwards capability. See -wsql=open for more information.
Linux
--
Shows the command line options for the esqlf command.
Windows
-?
Shows the command line options for the esqlf command.
 
-wsql=entry_
SQL92

-wsql=open
Causes the preprocessor to flag any usage of syntax or features that do not conform to the ISO Entry SQL92 entry level standard. (This is also known as the "FIPS flagger" option.)
Use open only with OpenSQL syntax. -wsql = open generates a warning if the preprocessor encounters an Embedded SQL statement that does not conform to OpenSQL syntax. (For OpenSQL syntax, see the OpenSQL Reference Guide.) This flag is useful if you intend to port an application across an Enterprise Access product. The warnings do not affect the generated code and the output file may be compiled. This flag does not validate the statement syntax for any Enterprise Access product whose syntax is more restrictive than that of OpenSQL.
The Embedded SQL/Fortran preprocessor assumes that input files are named with the extension ".sf". You can override this default by specifying the file extension of the input file(s) on the command line. The output of the preprocessor is a file of generated Fortran statements in tab format with the same name and the extension ".f" (Linux) or ".for" (Windows).
If you enter the command without specifying any flags or a filename, Ingres displays a list of flags available for the command.
esqlf Command Options
The following table presents the command options available with esqlf.
Command
Comment
esqlf file1
Preprocesses "file1.sf" to:
      "file1.f" (Linux)
      "file1.for" (Windows)
esqlf file2.xf
Preprocesses "file2.xf" to
      "file2.f" (Linux)
      "file2.for" (Windows)
esqlf -l file3
Preprocesses "file3.sf" to:
      "file3.f" (Linux)
      "file3.for" (Windows)
and creates listing "file3.lis"
esqlf -s
Accepts input from standard input
esqlf -ffile4.out file4
Preprocesses "file4.sf" to "file4.out"
esqlf
Displays a list of flags available for this command
The Fortran Compiler
The preprocessor generates Fortran code. The code generated is in tab format, in which each Fortran statement follows an initial tab. For information on the Embedded SQL format acceptable as input to the preprocessor, see Embedded SQL Statement Syntax for Fortran).
The preprocessor uses "structure and record" syntax by default. If the ‑f90 flag is used, the preprocessor declares structures and records using the "type" syntax from the f90 standard as used by gfortran.
Linux:
Use the Linux f77 command to compile this code. You can use most of the f77 command line options. If you use the -i2 compiler flag to interpret integer and logical declarations as 2-byte objects, you must have run the Fortran preprocessor with the -i2 preprocessor flag.
As mentioned in The SQL Communications Area, you may want to use the -u compiler flag to verify that the SQLCA has been declared correctly with an include sqlca statement in all program units containing Embedded SQL statements.
The following example preprocesses and compiles the file "test1." The Embedded SQL preprocessor assumes the default extension:
esqlf test1
f77 test1.f
Windows:
Use the Windows df command to compile this code. The following compile options are required for Windows:
/name:as_is
Treat uppercase and lowercase letters as different.
/iface:nomixed_str_len_arg
Requests that the hidden lengths be placed in sequential order at the end of the argument list.
/iface:cref
Names are not decorated, the caller cleans the call stack, and var args are supported.
If you use the /integer_size:16 qualifier to interpret integer and logical declarations as 2-byte objects, you must have run the Fortran preprocessor with the -i2 flag.
As mentioned in the chapter "The SQL Communications Area," you may want to use the warnings=declarations qualifier to verify that the SQLCA has been declared correctly with an include sqlca statement in all program units containing Embedded SQL statements.
The following example preprocesses and compiles the file "test1." The Embedded SQL preprocessor assumes the default extension:
esqlf test1
df /compile_only /name:as_is /iface:nomixed_str_len_arg /iface:cref test1 
Note:  For any operating system specific information on compiling and linking ESQL/Fortran programs, see the Readme file.
Last modified date: 11/09/2022