Command Reference Guide > Command Reference Guide > Using Ingres Commands > esqlc Command--Invoke Embedded SQL Preprocessor for C
Was this helpful?
esqlc Command--Invoke Embedded SQL Preprocessor for C
The esqlc command invokes the Ingres embedded SQL (ESQL) preprocessor for C.
The esqlc command has the following format:
esqlc [flags] [filename]
filename
Specifies the name of the file that contains the embedded SQL statements.
flags
Specify options to the preprocessor.
These flags are common to most host language preprocessors.
Note:  Flags specific to the preprocessor for C are noted with (esqlc).
-{# | p}
(esqlc) Generates # line directives to the C compiler (by default, they are in comments). This flag is helpful when debugging the error messages from the C compiler.
-?
On Windows and VMS, lists the valid command line options.
--
On UNIX, lists the valid command line options.
-[no]blank_pad
(esqlc) Tells the preprocessor to pad (-blank_pad) or not pad (-noblank_pad) with blanks any data selected at run time into fixed-length char host variables. Padding is done to the declared length of the variable, less one byte for the C null terminator.
The setting -blank_pad generates code that complies with ANSI and ISO Entry SQL-92 data retrieval rules for fixed-length char variables.
The setting -noblank_pad complies with current data retrieval rules. Instead of padding with blanks, char data is null terminated to the length of the data retrieved. The default is -noblank_pad.
-[no]check_eos
(esqlc) Tells the preprocessor to check (check_eos) or not check (-nocheck_eos) for an end-of-string null terminator on char variables.
The setting -check_eos is provided for ANSI SQL-92 conformity. It raises an error if a null terminator is missing.
Default: -nocheck_eos
-d
Adds debugging information to the runtime database error messages generated by ESQL. The source file name, line number, and the erroneous statement are printed along with the error message.
-f[filename]
Writes preprocessor output to the specified file.
If the filename variable is omitted, the output is sent to standard output, one screen at a time.
If the -f flag is omitted, output is written to a file that has the same base name as the input file, and contains an extension corresponding to the language preprocessor you invoked. For information about filename extensions, consult your host language companion guide.
-iN
(esqlc) Sets the default size of integers to N bytes. N must be 1, 2, or 4. The default is 4.
-l
Writes preprocessor error messages to the preprocessor’s listing file and 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
Makes generated code appear in the listing file too.
-multi
Generates a thread safe code for use in multi-threaded ESQL applications.
-o[. ext]
Specifies whether to generate output files for include files.
If no extension is specified, the include file preprocessor does not create an output file. This does not affect the inclusion of files in the main program. The preprocessor generates a default extension for the translated include file statements unless you specify the -o.ext flag.
If an extension is specified, the include files are output to the specified extension after being preprocessed.
-s
Reads embedded commands from standard input and generates resulting code to standard output. This is useful for unfamiliar testing statements. If the -l option is specified with this flag, the listing file is called stdin.lis.
On Windows, to terminate the interactive session, type Ctrl + C.
On UNIX, to terminate the interactive session, type Ctrl + D.
On VMS, to terminate the interactive session, type Ctrl + Z.
-[no]sqlcode
Tells the preprocessor to assume (-sqlcode) or not assume
(-nosqlcode) the existence of a status variable named SQLCODE to receive status information from SQL statements. The declaration does not have to be in an exec sql begin/end declare section.
The -sqlcode setting is provided for ANSI SQL-92 conformity.
Default: -nosqlcode
-w
Prints warning messages.
-wsql=entry_SQL92 | open
Issues a warning if the preprocessor detects an embedded SQL statement that does not follow the specified syntax.
entry_SQL92 specifies the ANSI SQL-92 entry level standard. (This is also known as the FIPS flagger option.)
open specifies OpenSQL syntax. This flag is useful if you intend to port an application across different Enterprise Access products. Warnings do not halt or affect the success of compilation. This flag does not validate the statement syntax for any SQL gateway whose syntax is more restrictive than that of OpenSQL.
Note:  The flag –wopen is identical to –wsql=open, and is supported for backward compatibility.
For a complete description of the SQL preprocessor requirements for C, see the Embedded SQL Companion Guide.
Last modified date: 08/28/2024