Check for ANSI-standard SQL syntax

When you compile the program, you can instruct the preprocessor to check for HCL OneDB™ 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 program, checks for ANSI compatibility. For information about how to set DBANSIWARN, see the HCL OneDB 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 HCL OneDB 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 to check for ANSI compatibility at run time.

With the -ansi option, the preprocessor generates a warning message when it encounters the HCL OneDB 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 HCL OneDB extensions to the ANSI-standard syntax:
esql -ansi demo1.ec

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