# empesql

    EMPESQL(1)                                                          EMPESQL(1)

    NAME
           empesql  -  precompiles  C/FORTRAN  programs for EMPRESS Embedded Query
           Language commands

    SYNOPSIS
           empesql {[-psmdb  database]}  {[-psmdbs   database  [database...]  --]}
           [-pthread] [-debug] infile.c
             [outfile.c]

           empesql  {[-psmdb  database]}  {[-psmdbs   database  [database...] --]}
           [-pthread] [-debug] infile.pc
             [outfile.c]

           empesql infile.f [outfile.f [supfile.c]]

           empesql infile.pf [outfile.f [supfile.c]]

           empesql infile.c [outfile.c]

    DESCRIPTION
           Empesql allows Empress users to issue SQL commands from within their  C
           program.   This  is  accomplished  through calls to the Empress mx rou-
           tines.  On precompilation, SQL commands embedded in  your  program  are
           replaced  with  calls  to  supporting functions.  In the case of C pro-
           grams, if no names are specified outfile.c will default to mpout.c.  In
           the  case of FORTRAN programs, if no names are specified for the gener-
           ated files, outfile.f will default to mpout.f  and  supportfile.c  will
           default to mpsup.c.

           In  order  to  find  the PSM routine name in the corresponding database
           when the program is precompiled, the -psmdb option or -psmdbs  must  be
           used  and the PSM routine name must be found in the listed database(s).
           Otherwise, error message will occur.

           The -psmdb  option  allows  only one  database  name to  be  specified.
           The  -psmdbs  option  can be used to  specify a list of database names.
           The database names are passed as a list  of  arguments and   terminated
           by  "--".   The database name may contain spaces or special characters.
           In the case of -psmdbs  option, quotes (") are needed for these  compex
           database names. Both option can be used repeatedly.

           The  option  -pthread  is used to generate thread-safe code for program
           that is written for the multi-threaded  application.  This  means  that
           Empress  routines  can be invoked in a multi-threaded application. This
           is done by multiple threads in parallel;  however  their  execution  is
           serialized.  The net effect is the same as running in a single threaded
           environment.

           The effect of an ESQL statement is global to all threads.  For example,
           the opening or closing of a table from one thread is visible to all the
           threads within  a  process.  The  multi-threaded  application  has  the
           responsibility for using these ESQL statements in a thread-safe manner,
           which is different from  whether  or  not  these  ESQL  statements  are
           thread-safe.   For  example, a multi-threaded application that closes a
           table that is still in use by other threads within the  application  is
           not using the close statement thread-safely.

           In  particular, various EXEC SQL sequences should be protected by user-
           specified explicit synchronization constructs if they are used in  mul-
           tiple threads. These include transactions: START TRANSACTION, ..., COM-
           MIT/ROLLBACK TRANSACTION and cursor usages: OPEN CURSOR,  FETCH,  CLOSE
           CURSOR.

           Various  global constructs are specified in ANSI SQL for returning sta-
           tus/error information.  The global constructs that are thread-safe are:
           SQLCODE,  SQLCNT and SQLWARN0.  Other global constructs such as SQLCMD,
           SQLWARN1, SQLERRMC and mroperr are not thread-safe.

           The option "-debug" prepares program for use with a debugger.  In order
           to  utilize  this "precompiler" option , pre-compiled program should be
           also compiled and link in the next phase with  debugging  option  (e.g.
           "empecc -g ..." )

    FILES
    SEE ALSO
           empcc(1), empecc(1), empef77(1)

           Empress Host Language: The SQL Precompiler

    DIAGNOSTICS
    HISTORY
           Written  by  Empress  Software  Inc..   All material is copyrighted and
           licensed.  Use on non-licensed CPUs is prohibited.

    Empress 8.62                 Empress Software Inc.                  EMPESQL(1)