Check for ANSI-standard SQL syntax

When you compile the Informix® ESQL/C program, you can instruct the preprocessor to check for Informix extensions to ANSI-standard SQL syntax in one of two ways:
  • You can set the DBANSIWARN environment variable.

    After you set the DBANSIWARN environment variable, every time you compile or run the Informix ESQL/C program, Informix ESQL/C checks for ANSI compatibility. For information about how to set DBANSIWARN, see the Informix Guide to SQL: Reference. For details about how to check for runtime warnings, see Opaque data types. For details on how to set environment variables, see the Informix Client Products Installation Guide for your operating system.

  • You can specify the -ansi option at compile time whenever you want to check for ANSI compatibility.

    The -ansi option does not cause Informix ESQL/C to check for ANSI compatibility at run time.

With the -ansi option, the Informix ESQL/C preprocessor generates a warning message when it encounters the Informix extension to ANSI SQL syntax. The following esql command preprocesses, compiles, and links the demo1.ec program and verifies that it does not contain any Informix extensions to the ANSI-standard syntax:
esql -ansi demo1.ec

If you compile a program with both the -ansi and -xopen options, the Informix ESQL/C preprocessor generates warning messages for Informix extensions to both ANSI and X/Open SQL syntax.