	 kvc ϸ5ϸ5by name         by name         service         d   
k ,             ϸ5ϸ5ϸ5         @        ./lpp_name                                    4 R S db2_02_01 {
db2_02_01.sdk.c 04.01.0002.4135 1 N U US_ENG DB2 C Language Include Files and Samples
[
*prereq db2_02_01.sdk.c 4.1.2.0

*ifreq db2_02_01.client 04.01.0002.4135
%
/usr/lpp/db2_02_01/include/sql.h 144
/usr/lpp/db2_02_01/include/sqlaprep.h 136
/usr/lpp/db2_02_01/include/sqlcli1.h 88
/usr/lpp/db2_02_01/include/sqlutil.h 368
/usr/lpp/db2_02_01/include/sqluvend.h 24
]
}
      k #          RE ϸ5ϸ5ϸ5          RE     ./usr/lpp/db2_02_01/db2_02_01.sdk.c/4.1.2.4135/liblpp.a                               <aiaff>
148414      0           68          124616      0           509         678         0           901224389   0           2           444         9   copyright `
Licensed Materials - Property of IBM

5765-453
(C) Copyright International Business Machines Corporation. 1993, 1996.

5765-454
(C) Copyright International Business Machines Corporation. 1993, 1996.

5765-455
(C) Copyright International Business Machines Corporation. 1993, 1996.

5765-642
(C) Copyright International Business Machines Corporation. 1993, 1996.

All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.
 188         974         68          901304192   2379        200         644         18  db2_02_01.sdk.c.al`
./usr/lpp/db2_02_01/include/sql.h
./usr/lpp/db2_02_01/include/sqlaprep.h
./usr/lpp/db2_02_01/include/sqlcli1.h
./usr/lpp/db2_02_01/include/sqlutil.h
./usr/lpp/db2_02_01/include/sqluvend.h
201         1286        678         901304194   0           200         444         20  db2_02_01.sdk.c.size`
/usr/lpp/db2_02_01/include/sql.h 144
/usr/lpp/db2_02_01/include/sqlaprep.h 136
/usr/lpp/db2_02_01/include/sqlcli1.h 88
/usr/lpp/db2_02_01/include/sqlutil.h 368
/usr/lpp/db2_02_01/include/sqluvend.h 24
 73          1472        974         901304193   2379        200         644         22  db2_02_01.sdk.c.prereq`
*prereq db2_02_01.sdk.c 4.1.2.0

*ifreq db2_02_01.client 04.01.0002.4135
 77          1666        1286        901230745   2379        200         644         26  db2_02_01.sdk.cobol.prereq`
*prereq db2_02_01.sdk.cobol 4.1.2.0

*ifreq db2_02_01.client 04.01.0002.4135
 75          1856        1472        901230752   2379        200         644         24  db2_02_01.sdk.cli.prereq`
*prereq db2_02_01.sdk.cli 4.1.2.0

*ifreq db2_02_01.client 04.01.0002.4135
 518         2490        1666        901304194   0           200         444         25  db2_02_01.sdk.c.inventory `
/usr/lpp/db2_02_01/include/sql.h:
	owner = bin
	group = bin
	mode = 444
	type = FILE
	size = 73035

/usr/lpp/db2_02_01/include/sqlaprep.h:
	owner = bin
	group = bin
	mode = 444
	type = FILE
	size = 69418

/usr/lpp/db2_02_01/include/sqlcli1.h:
	owner = bin
	group = bin
	mode = 444
	type = FILE
	size = 41269

/usr/lpp/db2_02_01/include/sqlutil.h:
	owner = bin
	group = bin
	mode = 444
	type = FILE
	size = 187539

/usr/lpp/db2_02_01/include/sqluvend.h:
	owner = bin
	group = bin
	mode = 444
	type = FILE
	size = 9724

98232       100822      1856        901303684   0           200         444         10  lpp.README`
  ***********************************************************************
  **                                                                   **
  **  (c) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1996.  **
  **                    ALL RIGHTS RESERVED.                           **
  **                                                                   **
  ***********************************************************************

                 Welcome to IBM Database Server for AIX!
                             Version 4.01


+--- NOTE! ----------------------------------------------------------+
|                                                                    |
| Set the font to monospace for better viewing of this README.       |
|                                                                    |
+--------------------------------------------------------------------+

This README file contains information for the following Database Server
products and components:

AIX-Specific
------------
 IBM DB2 Server (DB2 for AIX Version 2.1.2)
 IBM DB2 World Wide Web Connection

For last minute information on IBM Distributed Database Connection
Services Multi-User Gateway for Windows NT see the DDCSREAD.TXT readme file.

For information, see also

     Part Number   Publication
     -----------   -----------------------------------------------------------
     33H4879       IBM* Database Server for AIX Up and Running!

  ---------------------------------------------------------------------------


1.0  Contents

2.  INSTALLATION NOTES
2.1  New Commands to Facilitate Applying Service to DB2
2.2  Modifications to db2imigr, db2imigrev and db2idrop
2.3  Installing DDCS and Database Server on the Same Workstation
  2.3.1  Considerations When DDCS Is Already Installed
  2.3.2  Installing DDCS and Database Server
  2.3.3  Applying Fixes or Installing Additional Database Server Products

3.  ENVIRONMENT CONSIDERATIONS
3.1  Copying a Shared Library

4.  USAGE NOTES
4.1  Database Directory Utility
  4.1.1  Linking to Online Books from Database Director Online Help
  4.1.2  If Problems are Encountered when Running the Database Director
  4.1.3  DBCS Environment
4.2  Roll Forward and Log File Size
4.3  Using DCE Directories on AIX 4.1 Systems
4.4  Import/Load APIs
4.5  sqlestrd() API
4.6  Enabling IBM DB2-SMARTsort for DB2 LOAD
  4.6.1  Enabling SMARTsort under DB2
    4.6.1.1  Internal Information
  4.6.2  Disabling SMARTsort under DB2
  4.6.3  Programs
  4.6.4  DB2
4.7  DARI and UDF Considerations for National Language-Specific Processing
4.8  Package Name Considerations in Mixed Code Page Environments
4.9  Japanese and Traditional-Chinese EUC Code Page Environments
  4.9.1  Mixed EUC/Double-Byte Client and Database Considerations
  4.9.2  Character Conversion Considerations for Traditional-Chinese Users
    4.9.2.1  Code Page 964 (Traditional-Chinese EUC)
    4.9.2.2  Code Page 950 (Traditional-Chinese Big-5)

5.  COMMUNICATIONS ISSUES
5.1  TCP/IP
5.2  TZ Environment Variable
5.3  LAN Support Program and NetBIOS rc=0x18

6.  PROGRAMMING NOTES
6.1  Sample Applications
6.2  Considerations when Using Micro Focus COBOL
  6.2.1  Updating the Micro Focus COBOL Runtime System
  6.2.2  Configuring CICS for Use With DB2 2.1.2 and Micro Focus COBOL
         on UNIX Platforms
6.3  BINARY/COMP-4 COBOL Data Types in the DB2 Precompiler
6.4  Using REDEFINES in COBOL Group Data Items
6.5  Running DB2 for AIX COBOL Stored Procedures
6.6  Building Micro Focus COBOL Stored Procedures on AIX
6.7  Precompiler Customization
6.8  Considerations When Using REXX Stored Procedures
6.9  CLI/ODBC Multi-Thread Support

7.  DB2 WORLD WIDE WEB CONNECTION-SPECIFIC INFORMATION
7.1  Installation Notes
7.2  DB2 WWW Connection Configuration
7.3  Usage Notes
  7.3.1  Authentication
7.4  Using the Sample Application
  7.4.1  Installation Notes
  7.4.2  DBCS Considerations When Using the Sample Application

8.  NEW FUNCTION ADDED TO THE V2.1.2 RELEASE
8.1  RENAME TABLE
8.2  Threaded Applications with Concurrent Access
  8.2.1  sqleSetTypeCtx()
    8.2.1.1  Return codes
  8.2.2  sqleBeginCtx()
    8.2.2.1  Return codes
  8.2.3  sqleEndCtx()
    8.2.3.1  Return codes
  8.2.4  sqleAttachToCtx()
    8.2.4.1  Return codes
  8.2.5  sqleDetachFromCtx()
    8.2.5.1  Return codes
  8.2.6  sqleGetCurrentCtx()
    8.2.6.1  Return codes
  8.2.7  sqleInterruptCtx()
    8.2.7.1  Return codes
8.3  Quick Guide to Using the SOCKS Enabled DB2 Client
  8.3.1  Requirements
  8.3.2  Environment Variables
  8.3.3  Using SOCKS via the command line processor:
  8.3.4  Using SOCKS via the CATALOG NODE API (sqlectnd):
  8.3.5  Troubleshooting
  8.3.6  Restrictions
  8.3.7  The IBM NetSP Secured Network Gateway V1.2 (SOCKS) Server
8.4  CREATE IN DATABASE
  8.4.1  Deferred Prepare Support for ODBC/CLI Applications
8.5  Support for Redirected Restore
  8.5.1  The SET TABLESPACE CONTAINERS Command
  8.5.2  The Changes to the RESTORE DATABASE Command
8.6  NLS Additions
8.7  DB2 Support for Java Code Development

9.  MISCELLANEOUS
9.1  DB2 Family Newsletter


2.  Installation Notes

2.1  New Commands to Facilitate Applying Service to DB2

Two new instance management scripts db2maint and db2mtoff are provided
to simplify the task of applying future service to Version 2.1.2
installations.  These new functions automate the tasks of shutting
down the database manager and preventing new applications from
starting during the application of maintenance to DB2.

The two new commands can be invoked as follows:

DB2MAINT [-F]
          The db2maint command places Version 2 in maintenance mode by
          stopping the database manager and preventing new database
          applications from starting.  The optional -f parameter is
          the force applications flag.  If this flag is specified then
          all active databases for all Version 2 instances on the
          current machine will be stopped.  If the -f parameter is not
          specified then an error will be returned if any active
          databases are detected.

DB2MTOFF
          Removes the product from maintenance mode, enabling new
          database applications to run.

The following tasks, which previously had to be performed manually
when applying service to DB2, are now performed automatically by
running the db2maint command with the "-f" option:

o   All active databases for all DB2 instances on the current system
    are automatically stopped.

o   The database managers for all DB2 instances on the current system
    are automatically stopped.

o   All Command Line Processor back-end processes are automatically
    terminated (previously this could only be accomplished by issuing
    the db2 terminate command in all sessions that were using the
    Command Line Processor).

o   The DB2 license daemon is automatically terminated.

o   The DB2 shared libraries are removed from memory.

o   New DB2 applications are prevented from starting.

The methodology for applying future service to DB2 is now simplified
to the following 4 steps:

1.  Run db2maint to put DB2 Version 2.1.2 into maintenance mode.

2.  Apply the DB2 maintenance (or install and remove required product
    options).

3.  For each Version 2.1.2 instance, run the db2iupdt command to
    update the instance.

4.  Run db2mtoff to turn maintenance mode OFF. This enables DB2
    applications to run at the new maintenance level.


2.2  Modifications to db2imigr, db2imigrev and db2idrop

The db2imigr script has also been modified so that it places the
Version 1 installation in maintenance mode.  This prevents new Version
1 database applications from starting on all Version 1 instances while
the db2imigr command is running.

The optional "-f" parameter has also been added to the db2imigr, the
db2idrop and the db2imigrev commands.  If this parameter is specified
then running these commands will automatically stop all active
databases and the database manager for the specified instance.  If the
"-f" parameter is not specified then these commands will return an
error if there are any active databases using the specified instance.

The following tasks, which previously had to be performed manually
when running the db2imigr, db2imigrev or db2idrop commands, are now
performed automatically by running these commands with the new "-f"
option:

o   All active databases for the specified DB2 instance are
    automatically stopped.

o   The database manager for the specified DB2 instance is
    automatically stopped.

o   All Command Line Processor back-end processes for the specified
    DB2 instance are automatically terminated (previously this could
    only be accomplished by issuing the db2 terminate command in all
    sessions that were using the Command Line Processor).

o   The DB2 license daemon is automatically terminated.

o   An attempt is made to remove the DB2 Version 1 shared libraries
    from memory (the DB2 Version 1 shared libraries will not be
    removed if there are other DB2 Version 1 instances that are
    currently using the shared libraries).

o   New DB2 applications are prevented from starting.

A new executable "db2ilistv1" is also provided which will list all
Version 1 instances on a machine. db2ilist_v1 does not have any input
parameters.


2.3  Installing DDCS and Database Server on the Same Workstation


2.3.1  Considerations When DDCS Is Already Installed

If DDCS was installed from the DB2 Family CD or tape, you MUST
re-install DDCS using the Database Server CD.  Otherwise, you will not
be able to apply any Database Server PTFs.  Use the instructions in
the Up and Running! book to help you install DDCS.


2.3.2  Installing DDCS and Database Server

If you want to install both DDCS and Database Server on the same
workstation, perform the following steps:

o   Order the DDCS Multi-User Gateway Version 2.3.1 program package to
    obtain a license key.  Do NOT INSTALL DDCS from this package.
o   Install both products from the Database Server CD.
o   Apply the keys for the DB2 Server and DB2 Software Developer's Kit
    that are provided in the Database Server box.
o   Apply the key for DDCS that is provided in the DDCS Multi-User
    Gateway box.  YOU MUST INSTALL DDCS FROM THE DATABASE SERVER CD.


2.3.3  Applying Fixes or Installing Additional Database Server
Products

Once the Database Server product is installed on a workstation, you
must install any additional products ONLY from the Database Server CD.
DO NOT install any products from the DB2 Family media.  You must apply
all PTFs for the workstation from the Database Server PTFs.  DO NOT
apply any PTFs from the DB2 Family PTFs.


3.  Environment Considerations

3.1  Copying a Shared Library

On occasion, a problem may occur when attempting to replace either a
stored procedure or a user-defined function shared library, with the
copy operation failing.  This is because AIX keeps a cache of
referenced libraries and does not allow the library to be overwritten.

One solution is to run /usr/sbin/slibclean to flush the AIX shared
library cache.  Another solution is to remove the library from the
target directory and then copy the library from the source directory
to the target directory.


4.  Usage Notes

4.1  Database Directory Utility


4.1.1  Linking to Online Books from Database Director Online Help

If you are using Database Director online help, and you try
double-clicking on a hypertext link in order to open an online book
but the book is not displayed (that is, you receive an error message),
it is possible that the online book has not been installed.  You may
need to install the English version of the book if it has not been
translated or the BOOKSHELF environment variable has not been set.

NOTE:   If the book is not translated and you wish to view the English
version, update the value of the environment variable BOOKSHELF to
include:

      /usr/lpp/db2_02_01/doc/%L:/usr/lpp/db2_02_01/doc/En_US

Where %L represents the language locale you selected in the initial
installation of online books.


4.1.2  If Problems are Encountered when Running the Database Director

If the Database Director program cannot be loaded, the problem may be
caused by the setting of the LIBPATH environment variable.  If this
problem occurs one solution is to unset the LIBPATH environment
variable by issuing the command:

    unset LIBPATH

before running the Database Director again.

If you are running another application in the same window as the
Database Director and the other application requires you to set
LIBPATH, then you can open another window and run the Database
Director from the newly open window (make sure you issue the command
"unset LIBPATH" in the new window).


4.1.3  DBCS Environment

If you are running AIX Version 4.1.3 in the DBCS environment,
selecting the Cancel pushbutton from some Database Director windows
may result in abnormal ending of your application.  This problem is
referenced in APAR #IX55448, and is fixed with PTF U441217.


4.2  Roll Forward and Log File Size

If the log file size (LOGFILSIZ) was modified during the course of
normal processing, then database level roll forward through these log
files will behave as follows:

On any invocation of roll forward, only log files with the same log
file size will be processed.  When roll forward encounters a log file
of different size (excluding truncated log files), roll forward
processing will stop and return error SQL1042N.  Diagnostic
information will be logged.  You will then be required to re-issue the
roll forward command to continue processing from the next log file.


4.3  Using DCE Directories on AIX 4.1 Systems

To use DCE Directory Services with DB2 on an AIX 4.1 system the AIX
4.1 system must be at level AIX 4.1.4 or higher and dce.pthreads.rte
must be installed.

If DB2 is installed on a system which is below level AIX 4.1.4 or it
is installed on an AIX 4.1.4 or higher system that does not have
dce.pthreads.rte installed and you later decide that you want to use
DCE Directory Services with DB2 on an AIX 4.1 system then you must do
the following:

Logon as root and do the following:

1.  Place DB2 into maintenance mode For example,

            /usr/lpp/db2_02_01/instance/db2maint -f

2.  Upgrade your AIX 4.1 system to level AIX 4.1.4 or higher and
    ensure that you also install the optional DCE Threads
    Compatibility Library (dce.pthreads.rte)

3.  Run the command:

            /usr/lpp/db2_02_01/cfg/db2cfgos

4.  For each instance on the machine run the command:

            /usr/lpp/db2_02_01/instance/db2iupdt instance

    (where instance is the name of the instance. You can get a list of
    all the instances on the machine by issuing the
    /usr/lpp/db2_02_01/instance/db2ilist command)

5.  Turn DB2 maintenance mode off For example,

            /usr/lpp/db2_02_01/instance/db2mtoff

User C/C++ applications that read DB2 database or database locator or
routing information objects from the DCE directory services on AIX
4.1.4, need to relink using the xlc_r4 or xlC_r4 command.

The following is the error returned by the application if it is not
relinked:

  The DCE Compatibility Library was not initialized.
  The application may not have been compiled with the correct
  compiler (cc_r4/xlc_r4).

NOTE:  There are no limitations on AIX 3.2.


4.4  Import/Load APIs

The following are changes to the import API:

o   Additional information is stored in IXF files to be used by import
    with the CREATE option.  If you specify a select statement of the
    format "SELECT * FROM tablename" on export, the following
    information will also be retrieved and stored in the IXF file:

    -   The default value for each column
    -   The original lob length even if the data is being truncated or
        the lobs are stored in individual files as specified with the
        LOBSINFILE option
    -   The user defined type.

    When the IXF file is used to create a new table, this new
    information will be used.

o   You can specify a target tablespace when issuing a import with the
    CREATE option.  New syntax allowed for the tcolstrg is:

      CREATE INTO tablename [(column_list)]
               [IN tablespace [INDEX IN indextblespace] [LONG IN longtblspace]]

    Note that to specify a tablespace for the indexes or long data,
    you must specify a tablespace for the table.

o   If you explicitly do not specify a source column for one of the
    target table columns, one of the following things will happen:

    -   If the column is defaultable, the default will be imported
    -   If the column is nullable and not defaultable, a NULL will be
        imported
    -   If the column is not nullable and not defaultable, an error
        will be returned and the utility will stop processing.

    Previously, if a source column was not provided, and if the column
    was nullable, a NULL would have been imported, but if the column
    was not nullable, an error would have been returned.  If the old
    behavior is desired, specify the NODEFAULTS option in the
    filetype-modifier.

The following is a change to both the import and load APIs:

o   A source column may be designated for a target table column but
    may be omitted for any given row instance.  Examples of missing
    data are:

    -   For DEL files, ",," is specified for the column
    -   For DEL/ASC/WSF files, a row that does not have enough columns
        or is not long enough for the original specification.

    In these cases, import/load was used to import/load a NULL if the
    column was nullable, and reject the row if the column is not
    nullable.  If the USEDEFAULTS option is specified in the
    filetype-modifier, the following will be the new behavior:

    -   If the column is defaultable, the default will be
        imported/loaded
    -   If the column is nullable and not defaultable, a NULL will be
        imported/loaded
    -   If the column is not nullable and not defaultable, the row
        will be rejected.


4.5  sqlestrd() API

Applications which use the sqlestrd() API to connect to databases must
change this to EXEC SQL CONNECT syntax if the application needs to
take advantage of using version 2 distributed unit of work features
specified by precompiler options.


4.6  Enabling IBM DB2-SMARTsort for DB2 LOAD

The following information applies to the use of DB2 LOAD to load a
table:

For AIX environments, the DB2-SMARTsort Accelerator provides improved
performance when compared to the current performance of DB2 LOAD with
Index Create without SMARTsort.

SMARTsort is designed to work with IBM's DB2 2.1.2 with the
appropriate service update.  When used in conjunction with DB2's LOAD
with Create Index function, SMARTsort can reduce the time it takes to
load a database, especially when processing large amounts of data.
Once SMARTsort is enabled under DB2, DB2 calls SMARTsort automatically
every time the LOAD with Index Create function is invoked.  All
programs, scripts or command line calls that use DB2 LOAD with Index
Create can take full advantage of the performance of SMARTsort.

NOTE:  See the SMARTsort Release 2 READ.ME file for specific service
       requirements.

Users also have the option to produce a log of all SMARTsort
invocations made by DB2, or, they can choose not to create such a log
and allow all DB2-to-SMARTsort calls to be transparent.  Either way,
DB2 Loads will be able to exploit the performance advantages of using
SMARTsort, without any additional set-up by the user.


4.6.1  Enabling SMARTsort under DB2

Any DB2 user who wishes to use SMARTsort, during DB2 LOAD with Index
Create processing, can enable its use by adding the DB2SORT
environmental variable to their .profile or db2profile file.  As with
other DB2 environmental variables, the DB2SORT environmental variable
must be exported before starting DB2.  It may also be necessary to
issue a 'db2stop' and 'db2start' command to stop and restart the
database manager.

  DB2SORT=SMARTSORT
  export DB2SORT


By exporting the optional DB2SORTLOG environmental variable (see
Figure 2), you can collect a log of all DB2 invocations of SMARTsort.
DB2SORTLOG should be set to the name of a directory that SMARTsort can
write to.  Each time DB2 invokes SMARTsort, SMARTsort makes an entry
to the smrtsort.log file, located in this directory.  For example:
DB2SORTLOG=/tmp would create a smrtsort.log file and a serverX.log
file, in a directory named /tmp.

If no directory name is specified, or an invalid directory name is
provided, no log file is created.

  DB2SORTLOG=/tmp
  export DB2SORTLOG


The smrtsort.db2 file, located in /usr/lpp/smartsort (see Figure 3),
shows how the DB2SORT and DB2SORTLOG environmental variables can be
coded in a functioning Shell Script.  You can call this Script
directly from your db2profile or .profile file.

  #----------------------------------------------------------------
  # Licensed Materials: Property of IBM

  # 5765-349
  # (c) IBM Corporation 1994, 1996
  # All Rights Reserved
  #
  # NAME: smrtsort.db2
  #
  # DESCRIPTION: This partial script sample demonstrates how to
  # enable SMARTsort under DB2.
  #
  # USAGE: The contents of this script can be added to a user's
  # db2profile file to enable DB2's use of SMARTsort
  # during the LOAD operation.

  #
  # This script can also be invoked directly after
  # invoking the db2profile.
  #
  # A user may wish to copy this script into their
  # directory structure and customize it.
  #
  #-------------------------------------------------------------


  #-------------------------------------------------------------
  # DB2SORT Default=
  # is set to SMARTSORT to enable the use of SMARTsort during DB2
  # LOAD processing.
  #-------------------------------------------------------------
  DB2SORT=SMARTSORT
  export DB2SORT

  #-------------------------------------------------------------
  # DB2SORTLOG Default=
  # is set to a directory name in which SMARTsort is to create a
  # log file (called smrtsort.log). Each time SMARTsort is invoked
  # by DB2, SMARTsort will write a message to this log file. See
  # the SMARTsort Guide and Reference for more information.
  #----------------------------------------------------------------
  #DB2SORTLOG=/tmp

  #export DB2SORTLOG



4.6.1.1  Internal Information

There are two additional DB2 profile entries needed to activate the
use of DB2SORTLOG, they are:

   DB2SORTDEBUG=ON
   DB2SORTDATA=ON

If either of these entries are OFF, the DB2SORTLOG will not be used.


4.6.2  Disabling SMARTsort under DB2

To revert to the default DB2 sort when executing a DB2 LOAD, simply
reset the DB2SORT environment variable (see Figure 4).  Again, it may
be necessary to issue a 'db2stop' and a 'db2start' to stop and restart
the database manager.

  DB2SORT=
  export DB2SORT



4.6.3  Programs

The SMARTsort Release 2 DB2-SMARTsort Accelerator is currently only
supported on AIX as follows:

1.  The minimum release level for AIX is 4.1.3

2.  The required License Use Management run-time programs, and their
    pre-reqs, are shipped as part of the AIX operating system.  Check
    your AIX operating system to determine if the IBM SystemView
    License Use Management product, or the iFOR/LS product is
    installed on your system.


4.6.4  DB2

The DB2-SMARTsort Accelerator consists of SMARTsort Release 2 and PTF
U442530 for DB2 V2.1.1, which supports the new DB2SORT and DB2SORTLOG
parameters.


4.7  DARI and UDF Considerations for National Language-Specific
Processing

By default, DB2 DARI stored procedures and user defined functions,
when invoked, execute under a default national language environment
which may not match the database's.  Consequently, country or code
page specific operations, such as the use of C wchar_t graphic host
variables and functions, may not work as expected.  Application
developers need to ensure that, if applicable, the correct environment
is initialized when the stored procedure or UDF is invoked.


4.8  Package Name Considerations in Mixed Code Page Environments

Package names are generated as part of the invocation of the
PRECOMPILE PROGRAM command or API.  By default, they are generated
based on the first 8 bytes of the application program source file
(minus the extension and folded to upper case).  Optionally, a name
can be explicitly defined.  Regardless of the origin of the package
name attention should be paid in mixed code page environments to
ensure that the package name does become modified as result of
conversions between the application code page and the database code
page.  A modification due to character conversion will occur if any of
the characters in the package name (or fragments of a character in a
multi-byte code page ) are not directly mapped to a valid character in
the database code page.  In such cases a substitution character
replaces the unconverted character.  After such a modification, the
package name, when converted back to the application code page, may
not match the original.  An example of a case where this behavior is
undesirable would be while using the DB2 Database Director to list and
work with packages.  Package names displayed may not match expected
names.

To avoid conversion problems with package names ensure that only
characters are used which are valid under both the application and
database code pages.


4.9  Japanese and Traditional-Chinese EUC Code Page Environments


4.9.1  Mixed EUC/Double-Byte Client and Database Considerations

The administration of database objects in mixed EUC and double-byte
code page environments is complicated by the possible expansion or
contraction in the length of object names as a result of conversions
between the client and database code page. In particular, many
administrative commands and utilities have documented limits to the
lengths of character strings which they may take as input or output
parameters.  These limits are typically enforced at the client, unless
documented otherwise. For example, the limit for a table name is 18
bytes.  It is possible that a character string which is 18 bytes under
a double-byte code page is larger, say 21 bytes, under an EUC code
page.  This hypothetical 21-byte table name would be considered
invalid by such commands as REORGANIZE TABLE if used as an input
parameter despite being valid in the target double-byte database.
Similarly, the maximum permitted length of output parameters may be
exceeded, after conversion, from the database code page to the
application code page. This may cause either a conversion error or
output data truncation to occur.

If the extensive use of administrative commands and utilities is
expected in a mixed EUC and double-byte environment it is recommended
that database objects and associated data are defined with the
possibility of length expansion past supported limits, due to
conversion, kept in mind.  Administration of an EUC database from a
double-byte client will face less restrictions then administration of
a double-byte database from an EUC client.  The reason being that
double-byte character strings will always be equal in length or
shorter then the corresponding EUC character string.  This will
generally lead to less problems caused by character string length
limits being enforced.

Note: In the case of SQL statements, validation of input parameters is
not done until the entire statement has been converted to the database
code page.  This permits character strings to be used which may be
technically longer then allowed when represented in the client code
page but which meet length requirements when represented in the
database code page.

For more information concerning mixed code page environments refer to
the "Application Programming Guide" and the "SQL Reference".


4.9.2  Character Conversion Considerations for Traditional-Chinese
Users

A database or application running under the Traditional-Chinese EUC
code page will actually store and manipulate graphic data using the
ISO 10646 UCS-2 code set, a double-byte encoding scheme which is a
proper subset of the full ISO 10646 Unicode standard.  As part of the
standards definition for Traditional-Chinese, there is a side effect
which will be encountered when converting some characters between
double-byte or EUC code pages and UCS-2. There are 189 characters (187
radicals, 2 numbers) which share the same UCS-2 code point, when
converted, as another character in the code set. When these characters
are converted back to double-byte or EUC they will be converted to the
code point of the same character's ideograph, with which it shared the
same UCS-2 code point, rather then back to the original code point.
The character, when displayed, appears the same but is encoded
differently.  Depending on the design of your application, this
behavior may need to be taken into account.

The tables below list the EUC (code page 964) and double-byte (code
page 950) code points which, when converted to UCS-2 and then back to
the original code set, will experience this behavior.  Each entry in
the table is composed of three columns, for example the first entry in
the table for code page 964 is:

       (1)     (2)     (3)
       964 -> UCS-2 -> 964
       ----   ------   --------
       a7a1   4e00     c4a1

Each column contains the hexadecimal encoding of a code point
belonging to the code set/code page indicated by the column title:

o   Column (1) contains the original character's code point, read as
    x'a7a1', under code page 964 (Traditional-Chinese EUC).

o   Column (2) contains the code point, read as x'4e00', of the
    character in column (1) as represented under the UCS-2 code set.
    The arrow, '->', indicates the flow of conversion.  x'a7a1', when
    converted to UCS-2, is x'4e00'.

o   Column (3) contains the code point, read as x'c4a1', of the
    character in column (2) as represented under code page 964.  The
    arrow, '->', indicates the flow of conversion.  x'4e00', when
    converted to Traditional-Chinese EUC, is x'c4a1'.

Note:  For more detailed information concerning the usage of UCS-2 and
EUC refer to the "DB2 for AIX Installation and Operation Guide" and
the "Application Programming Guide".


4.9.2.1  Code Page 964 (Traditional-Chinese EUC)

  964 -> UCS-2 -> 964       964 -> UCS-2 -> 964       964 -> UCS-2 -> 964
  ----   -----    --------  ----   -----    --------  ----   -----    --------
  a4be   5341     c4b2      a7f4   6c34     c5d5      a8d7   8c37     cbc7
  a4c0   5345     c5ab      a7f5   706b     c5d6      a8d8   8c46     cbc8
  a7a1   4e00     c4a1      a7f6   722a     c5d7      a8d9   8c55     cbc9
  a7a5   4e59     c4a2      a7f7   7236     c5d8      a8da   8c78     8ea2a5a4
  a7a7   4e8c     c4a8      a7f8   723b     c5d9      a8db   8c9d     cbca
  a7a9   4eba     c4a9      a7f9   723f     8ea2a1c2  a8dc   8d64     cbcb
  a7aa   513f     c4aa      a7fa   7247     c5da      a8dd   8d70     cbcc
  a7ab   5165     c4ab      a7fb   7259     c5db      a8de   8db3     cbcd
  a7ac   516b     c4ac      a7fc   725b     c5dc      a8df   8eab     cbce
  a7b0   51e0     c4ad      a7fd   72ac     c5dd      a8e0   8eca     cbcf
  a7b1   51f5     8ea2a1a3  a7fe   7384     c6e8      a8e1   8f9b     cbd0
  a7b2   5200     c4ae      a8a1   7389     c6e9      a8e2   8fb0     cbd1
  a7b3   529b     c4b0      a8a2   74dc     c6ea      a8e4   9091     cbd7
  a7b5   5315     c4b1      a8a3   74e6     c6eb      a8e5   9149     cbdc
  a7b6   531a     8ea2a1a4  a8a4   7518     c6ec      a8e6   91c6     cbdd
  a7b8   5341     c4b2      a8a5   751f     c6ed      a8e7   91cc     cbde
  a7b9   535c     c4b3      a8a6   7528     c6ee      a8e8   91d1     cfda
  a7bb   5382     8ea2a1a5  a8a7   7530     c6f0      a8e9   9577     cfdb
  a7bd   53c8     c4b4      a8a8   758b     c6f4      a8ea   9580     cfdc
  a7be   53e3     c4c7      a8ab   767d     c6f5      a8eb   961c     cfdd
  a7bf   56d7     8ea2a1aa  a8ac   76ae     c6f6      a8ed   96b9     cfe3
  a7c0   571f     c4c8      a8ad   76bf     c6f7      a8ee   96e8     cfe4
  a7c1   58eb     c4c9      a8ae   76ee     c6f8      a8ef   9752     cfe5
  a7c3   5915     c4ca      a8af   77db     c6f9      a8f0   975e     cfe6
  a7c4   5927     c4cb      a8b0   77e2     c6fa      a8f1   9762     d3f2
  a7c5   5973     c4cc      a8b1   77f3     c6fb      a8f2   9769     d3f3
  a7c6   5b50     c4cd      a8b2   793a     c6fc      a8f3   97cb     d3f4
  a7c8   5bf8     c4d0      a8b3   79b8     8ea2a1e7  a8f4   97ed     d3f5
  a7c9   5c0f     c4d1      a8b4   79be     c6fd      a8f5   97f3     d3f6
  a7ca   5c22     c4d2      a8b5   7a74     c6fe      a8f6   9801     d3f7
  a7cb   5c38     c4d3      a8b6   7acb     c7a1      a8f7   98a8     d3f8
  a7cc   5c6e     8ea2a1ab  a8b7   7af9     c8cc      a8f8   98db     d3f9
  a7cd   5c71     c4d4      a8b8   7c73     c8cd      a8f9   98df     d3fa
  a7cf   5de5     c4d6      a8b9   7cf8     c8ce      a8fa   9996     d3fb
  a7d0   5df1     c4d7      a8ba   7f36     c8cf      a8fb   9999     d3fc
  a7d1   5dfe     c4da      a8bb   7f51     8ea2a2e9  a8fc   99ac     d8eb
  a7d2   5e72     c4db      a8bc   7f8a     c8d0      a8fd   9aa8     d8ec
  a7d6   5efe     c4dc      a8bd   7fbd     c8d1      a8fe   9ad8     d8ed
  a7d7   5f0b     c4dd      a8be   8001     c8d2      a9a1   9adf     8ea2b3cc
  a7d8   5f13     c4de      a8bf   800c     c8d4      a9a2   9b25     d8ee
  a7db   5f73     8ea2a1ac  a8c0   8012     c8d5      a9a3   9b2f     8ea2b3cd
  a7dc   5fc3     c5c0      a8c1   8033     c8d6      a9a4   9b32     d8ef
  a7dd   6208     c5c1      a8c2   807f     c8d7      a9a5   9b3c     d8f0
  a7de   6236     c5c2      a8c3   8089     c8d8      a9a6   9b5a     dea3
  a7df   624b     c5c3      a8c4   81e3     c8db      a9a7   9ce5     dea4
  a7e0   652f     c5c5      a8c5   81ea     c8dc      a9a8   9e75     dea5
  a7e2   6587     c5c6      a8c6   81f3     c8dd      a9a9   9e7f     dea6
  a7e3   6597     c5c7      a8c7   81fc     c8de      a9aa   9ea5     dea7
  a7e4   65a4     c5c8      a8c8   820c     c8df      a9ab   9ebb     dea8
  a7e5   65b9     c5c9      a8c9   821b     c8e0      a9ac   9ec3     e3a7
  a7e7   65e5     c5ca      a8ca   821f     c8e1      a9ad   9ecd     e3a8
  a7e8   66f0     c5cb      a8cb   826e     c8e2      a9ae   9ed1     e3a9
  a7e9   6708     c5cc      a8cc   8272     c8e3      a9af   9ef9     8ea2c1d5
  a7ea   6728     c5cd      a8cd   8278     8ea2a2ea  a9b0   9efd     8ea2c8f5
  a7eb   6b20     c5ce      a8ce   864d     8ea2a2ef  a9b1   9f0e     e7ef
  a7ec   6b62     c5cf      a8cf   866b     c8e5      a9b2   9f13     e7f0
  a7ed   6b79     c5d0      a8d0   8840     c8e6      a9b3   9f20     e7f1
  a7ee   6bb3     8ea2a1bf  a8d1   884c     c8e7      a9b4   9f3b     ebfc
  a7ef   6bcb     c5d1      a8d2   8863     c8e8      a9b5   9f4a     ebfd
  a7f0   6bd4     c5d2      a8d3   897e     8ea2a2f0  a9b6   9f52     f0af
  a7f1   6bdb     c5d3      a8d4   898b     cbc4      a9b7   9f8d     f3be
  a7f2   6c0f     c5d4      a8d5   89d2     cbc5      a9b8   9f9c     f3bf
  a7f3   6c14     8ea2a1c1  a8d6   8a00     cbc6      a9b9   9fa0     8ea2e1c2


4.9.2.2  Code Page 950 (Traditional-Chinese Big-5)

  950 -> UCS-2 -> 950       950 -> UCS-2 -> 950       950 -> UCS-2 -> 950
  ----   -----    ----      ----   -----    ----      ----   -----    ----
  a2cc   5341     a451      f59f   6c34     a4f4      f79e   8c37     a8a6
  a2ce   5345     a4ca      f5a0   706b     a4f5      f79f   8c46     a8a7
  f481   4e00     a440      f681   722a     a4f6      f7a0   8c55     a8a8
  f483   4e59     a441      f682   7236     a4f7      f881   8c78     cba4
  f484   4e8c     a447      f683   723b     a4f8      f882   8c9d     a8a9
  f485   4eba     a448      f684   723f     c962      f883   8d64     a8aa
  f486   513f     a449      f685   7247     a4f9      f884   8d70     a8ab
  f487   5165     a44a      f686   7259     a4fa      f885   8db3     a8ac
  f488   516b     a44b      f687   725b     a4fb      f886   8eab     a8ad
  f489   51e0     a44c      f688   72ac     a4fc      f887   8eca     a8ae
  f48a   51f5     c942      f689   7384     a5c8      f888   8f9b     a8af
  f48b   5200     a44d      f68a   7389     a5c9      f889   8fb0     a8b0
  f48c   529b     a44f      f68b   74dc     a5ca      f88a   9091     a8b6
  f48d   5315     a450      f68c   74e6     a5cb      f88b   9149     a8bb
  f48e   531a     c943      f68d   7518     a5cc      f88c   91c6     a8bc
  f48f   5341     a451      f68e   751f     a5cd      f88d   91cc     a8bd
  f490   535c     a452      f68f   7528     a5ce      f88e   91d1     aaf7
  f491   5382     c944      f690   7530     a5d0      f88f   9577     aaf8
  f492   53c8     a453      f691   758b     a5d4      f890   9580     aaf9
  f493   53e3     a466      f692   767d     a5d5      f891   961c     aafa
  f494   56d7     c949      f693   76ae     a5d6      f892   96b9     ab41
  f495   571f     a467      f694   76bf     a5d7      f893   96e8     ab42
  f496   58eb     a468      f695   76ee     a5d8      f894   9752     ab43
  f497   5915     a469      f696   77db     a5d9      f895   975e     ab44
  f498   5927     a46a      f697   77e2     a5da      f896   9762     adb1
  f499   5973     a46b      f698   77f3     a5db      f897   9769     adb2
  f49a   5b50     a46c      f699   793a     a5dc      f898   97cb     adb3
  f49b   5bf8     a46f      f69a   79b8     c9a8      f899   97ed     adb4
  f49c   5c0f     a470      f69b   79be     a5dd      f89a   97f3     adb5
  f49d   5c22     a471      f69c   7a74     a5de      f89b   9801     adb6
  f49e   5c38     a472      f69d   7acb     a5df      f89c   98a8     adb7
  f49f   5c6e     c94b      f69e   7af9     a6cb      f89d   98db     adb8
  f4a0   5c71     a473      f69f   7c73     a6cc      f89e   98df     adb9
  f581   5de5     a475      f6a0   7cf8     a6cd      f89f   9996     adba
  f582   5df1     a476      f781   7f36     a6ce      f8a0   9999     adbb
  f583   5dfe     a479      f782   7f51     ca49      f981   99ac     b0a8
  f584   5e72     a47a      f783   7f8a     a6cf      f982   9aa8     b0a9
  f585   5efe     a47b      f784   7fbd     a6d0      f983   9ad8     b0aa
  f586   5f0b     a47c      f785   8001     a6d1      f984   9adf     d449
  f587   5f13     a47d      f786   800c     a6d3      f985   9b25     b0ab
  f588   5f73     c94c      f787   8012     a6d4      f986   9b2f     d44a
  f589   5fc3     a4df      f788   8033     a6d5      f987   9b32     b0ac
  f58a   6208     a4e0      f789   807f     a6d6      f988   9b3c     b0ad
  f58b   6236     a4e1      f78a   8089     a6d7      f989   9b5a     b3bd
  f58c   624b     a4e2      f78b   81e3     a6da      f98a   9ce5     b3be
  f58d   652f     a4e4      f78c   81ea     a6db      f98b   9e75     b3bf
  f58e   6587     a4e5      f78d   81f3     a6dc      f98c   9e7f     b3c0
  f58f   6597     a4e6      f78e   81fc     a6dd      f98d   9ea5     b3c1
  f590   65a4     a4e7      f78f   820c     a6de      f98e   9ebb     b3c2
  f591   65b9     a4e8      f790   821b     a6df      f98f   9ec3     b6c0
  f592   65e5     a4e9      f791   821f     a6e0      f990   9ecd     b6c1
  f593   66f0     a4ea      f792   826e     a6e1      f991   9ed1     b6c2
  f594   6708     a4eb      f793   8272     a6e2      f992   9ef9     dcb0
  f595   6728     a4ec      f794   8278     ca4a      f993   9efd     e0ef
  f596   6b20     a4ed      f795   864d     ca4f      f994   9f0e     b9a9
  f597   6b62     a4ee      f796   866b     a6e4      f995   9f13     b9aa
  f598   6b79     a4ef      f797   8840     a6e5      f996   9f20     b9ab
  f599   6bb3     c95f      f798   884c     a6e6      f997   9f3b     bbf3
  f59a   6bcb     a4f0      f799   8863     a6e7      f998   9f4a     bbf4
  f59b   6bd4     a4f1      f79a   897e     ca50      f999   9f52     bea6
  f59c   6bdb     a4f2      f79b   898b     a8a3      f99a   9f8d     c073
  f59d   6c0f     a4f3      f79c   89d2     a8a4      f99b   9f9c     c074
  f59e   6c14     c961      f79d   8a00     a8a5      f99c   9fa0     efb6


5.  Communications Issues

5.1  TCP/IP

If an application attempting a CONNECT to the server using the TCP/IP
protocol receives a -30081 error message with the first error token
containing a value of ETIMEDOUT (10060, 78, 145, 238) or EADDRINUSE
(10048, 67, 125, 226), or ECONNREFUSED (10061, 79, 146, 239); these
errors indicate that the server is handling too many incoming
connection requests or that the network is very busy.  The application
should pause for a short time then attempt the connection again.

Also, in the case where ECONNREFUSED is received, check that TCP/IP
support at the database server has been successfully started.

If you encounter EADDRINUSE errors during CONNECT, one of the
following fixes should be applied for APAR #IX41367:

PTF U435180
   or
PMP 3251 (PTF U493251)


5.2  TZ Environment Variable

When connecting a client to the server which runs on an operating
system that supports the concept of local time versus Universal
Coordinated Time (UCT, also known as Greenwich Mean Time or GMT), the
client machine should also set up timezone information that
corresponds to the server machine.  If it is not set, the client may
display certain timestamps (that are returned by the server)
incorrectly (being off by the difference between the UCT and local
time).

So for example, if a server is running under Pacific Standard Time
(PST) and a client is running under Eastern Standard Time (EST),
timestamps on the client will show PST unless the TZ variable is set.


5.3  LAN Support Program and NetBIOS rc=0x18

If you use IBM LAN Support Program to provide NetBIOS communications
protocol support, and you load the LAN Support Program device drivers
in DOS upper / high memory, you may encounter intermittent NetBIOS
communications errors "SQL30081, rc=0x18".  To avoid these
communications errors, load the LSP device drivers in conventional
memory.


6.  Programming Notes

6.1  Sample Applications

The following files contain information about the sample applications
which are used in the DB2 publications.  The sample applications will
only be useful to you if you have the DB2 Software Developer's Kit or
DB2 Single-User package for your platform installed.

    samples/c/README

        README file for the c sample applications.

    samples/cobol/README

        README file for the COBOL sample applications.

    samples/fortran/README
        README file for the FORTRAN sample applications.

    samples/rexx/README

        README file for the REXX sample applications.

    samples/cli/README

        README file for the Call Level Interface sample applications.

    samples/cli/INTCLI.DOC

        Documentation for the Interactive Call Level Interface applet.

    samples/clp/README

        README file for the Command Line Processor examples.

    samples/java/README

        README file for the DB2Java examples.


6.2  Considerations when Using Micro Focus COBOL

DB2 v2.1.2 has been modified to correctly handle abnormal termination
of Micro Focus COBOL applications compiled with the DB2 PREP command.
This ensures that partial transactions are rolled back in the event of
an error.

It is strongly recommended that any existing DB2 applications
precompiled with DB2 PREP and compiled with Micro Focus COBOL be
re-precompiled with the updated DB2 v2.1.2 precompiler, and then
re-compiled with Micro Focus COBOL.  If applications built with Micro
Focus COBOL and the IBM precompiler from a previous release/ version
are not rebuilt, there is a danger of database corruption if abnormal
termination occurs.

This support requires Micro Focus COBOL v3.2.

Once the necessary version of the Micro Focus compiler is available,
add the db2gmf library (-ldb2gmf) to your compile/link command as
follows (AIX):

    cob -x -o app app.cbl -ldb2 -ldb2gmf -L/usr/lpp/db2_02_01/lib

For stored procedures, the same new argument (-ldb2gmf) is added to
the compile/link command (AIX):

    cob -x -o app app.cbl -Q -H512 -Q -T512 -Q -e app \
        -Q -bE:app.exp -ldb2 -ldb2gmf -L/usr/lpp/db2_02_01/lib

Compile/line commands for other UNIX platforms are modified similarly,
by adding -ldb2gmf.


6.2.1  Updating the Micro Focus COBOL Runtime System

DB2 v2.1.2 for UNIX platforms provides an updated
sqllib/lib/db2mkrts.args file. This requires that the Micro Focus
COBOL runtime system, rts32, be rebuilt.  Follow the instructions for
building the Micro Focus COBOL runtime system under 'Developing
Applications with Micro Focus COBOL' in the DB2 Installation Guide.


6.2.2  Configuring CICS for Use With DB2 2.1.2 and Micro Focus COBOL
on UNIX Platforms

DB2 v2.1.2 requires changes in the way CICS is configured for use with
Micro Focus COBOL and DB2.   The object file sqlgmf.o contained in the
/usr/lpp/db2_02_01/lib/libdb2gmf.a archive needs to be extracted, and
used in the construction of the CICS runtime system.  Referring to the
CICS Administration Guide, perform the steps as documented under 'C
Transaction Support for DATABASE 2', if you have not already done so.
Then execute the following commands:

      cd /usr/lpp/db2_02_01/lib
      ar -vx libdb2gmf.a
      ln -s /usr/lpp/db2_02_01/lib/sqlgmf.o /usr/lib/db2gmf.o

Then, perform the steps under 'COBOL Transaction Support for DATABASE
2' in the CICS Administration Guide, with the following change.  Where
you are instructed to run cicsmkcobol to regenerate cicspsCOBOL, use
the following command instead of the one documented in the CICS
Administration Guide:

      cicsmkcobol /usr/lib/db2.o /usr/lib/db2gmf.o

This adds the sqlgmf API to the cicsprCOBOL runtime, allowing
applications precompiled with the DB2 v2.1.2 COBOL precompiler to
function correctly with CICS.


6.3  BINARY/COMP-4 COBOL Data Types in the DB2 Precompiler

The DB2 Precompiler supports use of BINARY, COMP-4 and COMP COBOL data
types wherever integer host variables and indicators are permitted, as
long as the target COBOL compiler views (or can be made to view)
BINARY/COMP-4/COMP as equivalent to COMP-5.  In the DB2 Application
Programming Guide, such host variables and indicators are shown with
type COMP-5.  Target compilers supported by DB2 which treat
BINARY/COMP-4/COMP and COMP-5 as equivalent are:

  IBM COBOL Set for AIX
  Micro Focus COBOL for AIX
  IBM COBOL Visual Set for OS/2 (with the -qbinary(native)
    option set)


6.4  Using REDEFINES in COBOL Group Data Items

The REDEFINES clause may be used when declaring host variables with
the DB2 COBOL precompiler.  If a member of a group data item is
declared with the REDEFINES clause, and that group data item is
referred to as a whole in an SQL statement, any subordinate items
containing the REDEFINES clause will not be expanded.  For example:

  01 foo.
      10 a pic s9(4) comp-5.
      10 a1 redefines a pic x(2).
      10 b pic x(10).

Referring to foo in an SQL statement like so:

      ... INTO :foo ...

is equivalent to

      ... INTO :foo.a, :foo.b ...

That is, the subordinate item a1 with the REDEFINES is not
automatically expanded out in such situations.  A subordinate with a
REDEFINES may be referred to in an SQL statement explicitly, as in

      ... INTO :foo.a1 ...
or
      ... INTO :a1 ...

if a1 is unambiguous.


6.5  Running DB2 for AIX COBOL Stored Procedures

Because of the way AIX loads stored procedures and resolves library
references within them, there are generally requirements on how
language products like COBOL should be installed.  When you are
running a normal executable, COBOL for example, these requirements are
not a factor.  They are, however, when it is a shared object (stored
procedure) being loaded on the fly.

When a stored procedure is loaded, the chain of libraries it refers to
must also be loaded.  When AIX searches for a library only indirectly
referenced by your program, it must use the path compiled into the
library that referenced it when it was built by the language provider
(in this case, Micro Focus** COBOL or the IBM COBOL group.)  This path
may very well not be the same path in which the compiler was
installed.  (If a library in the chain cannot be found, the stored
procedure load will fail, and you receive a -10013 sqlcode.)

To solve this problem, you can install the compiler wherever you want,
but you should then create symbolic links of all language libraries
from the install directory into /usr/lib (a directory which is almost
always searched when a library needs to be loaded.)  You could link
the libraries into sqllib/function (the stored procedure directory),
but this only works for one database instance.  /usr/lib works for
everyone on the machine.  Also, copying the libraries in is not
advised, especially for Micro Focus COBOL, since there may be problems
when multiple copies of the libraries exist.

A sample symbolic link of Micro Focus COBOL is provided below
(assuming it is installed in /usr/lpp/cobdir):

   [1]> su root
   [2]> cd /usr/lib
   [1]> ln -sf /usr/lpp/cobdir/coblib/*.a .


6.6  Building Micro Focus COBOL Stored Procedures on AIX

In order to build stored procedures with Micro Focus COBOL v3.2 for
AIX, "-B static" and "-Q -bI:" options must be added to the command
line, and "-ldb2" must be removed, relative to what is shown in the
Software Developer's Kit for AIX, Building Your Applications manual.

Below are shown the modified commands to build the server portion of
the inpcli/inpsrv sample client/server pair:

    db2 connect to sample
    db2 prep inpsrv.sqb
    cob -xc inpsrv.cbl
    cob -x -o inpsrv inpsrv.o -Q -e inpsrv -Q -bE:inpsrv.exp \
      -Q -bI:$HOME/sqllib/lib/db2g.imp -B static \
      -L$HOME/sqllib/lib


6.7  Precompiler Customization

If you are writing your own precompiler interface to DB2 Precompiler
Services, you should be aware that the program_id parameter to
sqlainit() must indicate static storage.  This storage is referred to
by the Precompiler Services functions sqlaalhv() and sqlacmpl() during
precompilation.  The program_id storage must remain accessible and
undisturbed until Precompiler Services has been terminated with a call
to sqlafini().


6.8  Considerations When Using REXX Stored Procedures

When using host variables in the CALL statement, each host variable
must be initialized to a value compatible in type with the data that
is returned into it from the server procedure (if any). It should be
done even if the corresponding indicator is negative.  When using
descriptor, SQLDATA must be initialized and contain data compatible in
type with the data that is returned from the server procedure (if
any). It should be done even if the SQLIND field contains negative
value.  (See also OUTCLI.CMD example in the Application Programming
Guide for common servers).


6.9  CLI/ODBC Multi-Thread Support

With release 2.1.2, both CLI and the ODBC driver are capable of
supporting multiple concurrent threads.

The multi-thread support can be enabled or disabled through the
"DisableMultiThread" db2cli.ini file setting ( 1 True, 0 False).
The default is True, Multi Thread support is disabled,
and CLI/ODBC will serialize all calls.

If DisableMultiThread is set =1 in the "COMMON] section of the
db2cli.ini file, CLI/ODBC calls will be serialized at the connection
level.

Only enable the multi-thread support if the application makes use
of multiple threads, and:
 - does not call any other DB2 APIs prior to calling SQLAllocEnv.
 - does not call sqleisig() or sqleintr() DB2 APIs.


7.  DB2 World Wide Web Connection-Specific Information

7.1  Installation Notes

If you have a beta version of DB2 World Wide Web Connection installed
on your system, delete it before installing the version included in
Database Server.

Note:  Make sure you back up all html documents before deleting the
beta version of the product.

If you have installed the DB2 WWW Connection alpha release, remove the
line "set LIBPATH=$LIBPATH:<your CGI>" from .cshrc and .profile.

If your Web Server uses directories other than
/usr/lpp/internet/server_root/cgi-bin for Web Server CGI executable
programs, /usr/lpp/internet/server_root/pub for the Web Server
document root directory (where HTML source files are stored), and
/usr/lpp/internet/server_root/icons for Web Server image files that
are used in HTML files, you will need to do the following before
running DB2 WWW Connection:

        - Update your Web Server configuration file to use the above
          directories -OR-

        - Copy db2www and db2sql.bnd to your Web Server's directory that stores
          CGI executable programs.
        - Copy db2www.ini and all of the htm files to your Web Server's
          document root directory.
        - Copy all of the gif files to your Web Server's image directory
        - Create the tmplobs directory (under the document root directory) and
          allow your Web Server to have write access to this directory.


7.2  DB2 WWW Connection Configuration

Configuration information for DB2 WWW Connection is in the file
'db2www.ini', which resides in the Web Server's document root
directory (e.g. /usr/lpp/internet/server_root/pub).  Inside the file,
there are three entries:

        MACRO_PATH  -specifies where the directory for the macro files are
        BINDFILE    -specifies the location of the bind file for DB2 WWW
        DB2INSTANCE -specifies the DB2 instance owner of the tables being
                     queried


7.3  Usage Notes

o   Make sure that the Web Server and database connection are running

o   Make sure that the file db2www.ini in the 'pub' directory has the
    correct settings.

o   If necessary, verify that all DB2 WWW Connection macros (including
    the sample application macros that are shipped with the product)
    use the LOGIN and PASSWORD variables.  See the explanation under
    "Authentication" below to determine if this step is necessary or
    not.

o   If you use the BLOB and CLOB features of DB2 WWW, be sure to
    periodically remove old temporary files in tmplobs directory.

o   Since the file 'db2www.ini' is viewable by other people using a
    Web Browser, we recommend that appropriate access restrictions on
    that file be enforced using the access control protocol provided
    by your Web Server.

    Further security can be provided by adding encryption and a
    firewall.  Refer to your Web Server documentation for details.

o   A template macro file (template.d2w) is provided in the macro
    directory to help you get started writing your own macro files.


7.3.1  Authentication

DB2 WWW Connection uses the user ID specified with the macro variables
LOGIN and PASSWORD for database access authentication.  If these
variables are not specified, the user ID which started the Web Server
daemon is used for database access authentication.

For example, if the Web Server was started with the database
administrator's user ID and DB2 WWW Connection uses a macro file that
does not have the LOGIN and PASSWORD variables defined, the query will
still be successful because the database administrator has privileges
which give unlimited database access.

If your Web Server was started with a user ID that does not have
database access authority, you must specify the LOGIN and PASSWORD
macro variables in all macro files that are used.  Note that this
applies to the sample macros that are shipped with DB2 WWW Connection.
Since these macro files do not use the LOGIN and PASSWORD variables,
you must add these variables to the macro files.

If your Web Server was started with a user ID that has database access
authority, you will not need to use the LOGIN and PASSWORD variables
in your macro files.  However, verify that this user ID has the
necessary Web Server directory and file read/write privileges.


7.4  Using the Sample Application


7.4.1  Installation Notes

o   The db2data subdirectory (installed in /usr/lpp/internet/db2www)
    contains the necessary data files for installing the sample
    database, "celdial".  These data files were exported using the ixf
    format.

o   When following the instructions provided in the Up and Running!
    book to install the sample application, make sure that the user ID
    that you are using can become an instance owner user ID.  For more
    information on instance owners, refer to the Up and Running!.

o   If necessary, update the DB2 WWW Connection macros to use the
    LOGIN and PASSWORD variables.  See the explanation under
    "Authentication" to determine if this step is necessary or not.

o   Update your Web Server's configuration to recognize the .htm file
    extension as an HTML/Text file, or rename all .htm files that were
    shipped with DB2 WWW Connection to .html files.  Note that if you
    rename these files, you will also need to update the references to
    these files in the .htm and .d2w files.


7.4.2  DBCS Considerations When Using the Sample Application

If you are installing the sample application on a DBCS server machine,
add 'MODIFIED BY FORCEIN' to each IMPORT command in the appropriate
command file.  This modifier directs DB2 to accept the data with no
code page conversion.  For example, change the line:

 DB2 IMPORT FROM CUSTSHIP OF IXF CREATE INTO CUSTSHIP
to
 DB2 IMPORT FROM CUSTSHIP OF IXF MODIFIED BY FORCEIN CREATE INTO CUSTSHIP


8.  New Function added to the V2.1.2 Release

8.1  RENAME TABLE


The RENAME TABLE statement renames an existing table.


8.1.1  Invocation

This statement can be embedded in an application program or issued
through the use of dynamic SQL statements.  It is an executable
statement that can be dynamically prepared.


8.1.2  Authorization

The privileges held by the authorization ID of the statement must
include either SYSADM or DBADM authority.


8.1.3  Syntax

+--------------------------------------------------------------------+
|                                                                    |
|             .-TABLE-.                                              |
| >>--RENAME--'-------'--source-table-name--TO---------------------> |
|                                                                    |
| >--target-identifier-------------------------------------------->< |
|                                                                    |
+--------------------------------------------------------------------+


8.1.4  Description

source-table-name
    Names the existing table that is to be renamed.  The name,
    including the schema name, must identify a table that already
    exists in the database (SQLSTATE 42704). It can be an alias
    identifying the table.  It must not be the name of a catalog table
    (SQLSTATE 42832) or an object of any type other than table or
    alias (SQLSTATE 42809).

target-identifier
    Specifies the new name for the table without a schema name.  The
    schema name of the source-table-name is used to qualify the new
    name for the table.  The qualified name must not identify a table,
    view, or alias that already exists in the database (SQLSTATE
    42710).


8.1.5  Rules

o   The source table must not:

    -   be referenced in any existing view definitions
    -   be referenced in any triggered SQL statements in existing
        triggers or be the subject table of an existing trigger
    -   have any check constraints
    -   be a parent or dependent table in any referential integrity
        constraints.

    An error (SQLSTATE 42986) is returned if the source table violates
    one or more of these conditions.


8.1.6  Notes

o   Catalog entries are updated to reflect the new table name.

o   All authorizations associated with the source table name are
    transferred to the new table name (the authorization catalog
    tables are updated appropriately).

o   Indexes defined over the source table are transferred to the new
    table (the index catalog tables are updated appropriately).

o   Any packages that are dependent on the source table are
    invalidated.

o   If an alias is used for the source-table-name, it must resolve to
    a table name.  The table is renamed within the schema of this
    table.  The alias is not changed by the RENAME statement and
    continues to refer to the old table name.

o   A table with primary key or unique constraints may be renamed if
    none of the primary key or unique constraints are referenced by
    any foreign key.


8.1.7  Example

Change the name of the EMP table to EMPLOYEE.

    RENAME TABLE EMP TO EMPLOYEE


8.2  Threaded Applications with Concurrent Access

Seven new APIs are available which allow separate environments
(contexts) to be allocated for each thread, and allow these contexts
to be passed among threads.

There are seven new APIs.

o   int sqleSetTypeCtx(lOptions)
o   int sqleBeginCtx(**pContext, lOptions, *reserved, *pSqlca)
o   int sqleEndCtx(**pContext, lOptions, *reserved, *pSqlca)
o   int sqleAttachToCtx(*pContext, *reserved, *pSqlca)
o   int sqleDetachFromCtx(*pContext, *reserved, *pSqlca)
o   int sqleGetCurrentCtx(**pContext, *reserved, *pSqlca)
o   int sqleInterruptCtx(*pContext, *reserved, *pSqlca)

where:

LOPTIONS            API specific:

                    o   sqleSetTypeCtx() - Options to handle thread
                        context (that is, use current style or use
                        true concurrent access).
                    o   sqleBeginCtx() - Indicates if context should
                        be created only or an attach done as well.
                    o   sqleEndCtx() - Indicates if context should be
                        destroyed only or detached as well.  (In
                        destroy only mode, destroy will fail if it is
                        not detached.)

PCONTEXT            A structure defining the context.  sqleBeginCtx()
                    allocates a data area out of private memory for
                    storage of context information.  This area will be
                    freed on a call to sqleEndCtx().

RESERVED            Reserved for future.

PSQLCA              Information on success or failure

These APIs may be used with embedded SQL or the XA APIs.

NOTES:

1.  If the new APIs are not used, the old behavior is in effect and
    existing applications need not change.

2.  Also note that CLI automatically uses the new scheme (CLI will
    create a new context for each incoming connection), and it is up
    to the user to disable this explicitly.

3.  The behavior of the prep, bind, import, export APIs remains
    unchanged at this time.

When using the new APIs, all work associated with a CONNECT has
effectively been disassociated with a process or thread, and now
resides with a context.  This context may be shuffled around between
threads in a process (but not between processes).


8.2.1  sqleSetTypeCtx()

    int sqleSetTypeCtx(long lOptions)

This is used to set the application context type, and should be the
first database API called inside the application. Option values
include:

o   SQL_CTX_ORIGINAL - All threads use the same context and therefore
    concurrent access will be blocked.  This is the current behavior
    and is the default if none of these APIs are called.

o   SQL_CTX_MULTI_MANUAL - All threads will use separate contexts and
    it is up to the application to manage the context for each thread
    (sqleBeginCtx(), sqleAttachToCtx(), sqleDetachFromCtx(),
    sqleEndCtx()).

This API must be called before any other type of database call
(utility APIs, embedded SQL, XA APIs, the other Ctx APIs, etc.) to
have any effect and only the first call will have any effect.  All
subsequent calls have no effect.

This API has no effect on platforms where application threading is not
supported.

The following is a list of restrictions/changes when
SQL_CTX_MULTI_MANUAL is used:

o   Automatic COMMIT at process termination (when termination is
    normal) is disabled.  All outstanding transactions will be rolled
    back, whether termination is normal or not.  (Note that this is
    the way DB2 for Windows NT has always worked).  This means that
    all COMMITs must be done explicitly within the program.

o   sqleintr() will interrupt all contexts.  Interrupt support on a
    per context basis is supplied by sqleInterruptCtx().


8.2.1.1  Return codes

o    0 - success
o   -1 - bad option


8.2.2  sqleBeginCtx()

    int sqleBeginCtx(void ** ppCtx,
                     long    lOptions,
                     void * reserved,
                     struct sqlca * pstSqlca)

This is used to create or create and attach to an application context.
More than one application context may be created.  Each has its own
commit scope.  Different threads can 'attach' (see below) to different
contexts.  Any database API calls made by such threads will not be
serialized with one another.

The options are as follows:

o   SQL_CTX_CREATE_ONLY - The context memory will be created only - no
    attach will be done.

o   SQL_CTX_BEGIN_ALL - The context will be allocated, then a call to
    sqleAttachToCtx will be made for the current thread.  If this
    option is used, the ppCtx parameter may be NULL.  If the thread is
    already attached to a context, the call will fail.

This API has no effect on platforms where application threading is not
supported.


8.2.2.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1219 - private memory could not be allocated
    -   -1441 - invalid parameter


8.2.3  sqleEndCtx()

    int sqleEndCtx(void ** pCtx,
                   long    lOptions,
                   void * reserved,
                   struct sqlca * pstSqlca)

This frees all memory associated with a given pCtx.

The options are as follows:

o   SQL_CTX_FREE_ONLY - The context memory will be freed only if a
    prior detach has been done.

    pCtx is expected to be a valid context previously allocated by
    sqleBeginCtx().

o   SQL_CTX_END_ALL - A call to sqleDetachFromCtx will be made if
    necessary, then the memory will be freed.  If this option is used,
    the ppCtx parameter may be NULL, but if it is passed, it is
    expected to be a valid context previously allocated by
    sqleBeginCtx().  A call to sqleGetCurrentCtx will be made and the
    current context freed.

If a database connection exists, or the context has been attached to
by another thread, this call will fail.  Note that if END_ALL was
requested, a detach will be done even if the context is still in use.

This API has no effect on platforms where application threading is not
supported.


8.2.3.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1219 - private memory could not be allocated
    -   -1444 - context in use
    -   -1441 - invalid parameter
    -   -1442 - context not in use


8.2.4  sqleAttachToCtx()

    int sqleAttachToCtx(void * pCtx,
                        void * reserved,
                        struct sqlca * pstSqlca)

This call is used to make the current thread use the context pointed
to by pCtx.  All subsequent database calls made on this thread will
use this context.  If more than one thread is attached to a given
context, access will be serialized for these threads and they will
share a commit scope.

pCtx is expected to be a valid context previously allocated by
sqleBeginCtx().

This API has no effect on platforms where application threading is not
supported.


8.2.4.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1219 - private memory could not be allocated
    -   -1441 - invalid parameter
    -   -1443 - thread already using context


8.2.5  sqleDetachFromCtx()

    int sqleDetachFromCtx(void * pCtx,
                          void * reserved,
                          struct sqlca * pstSqlca)

This call detaches the context in use by the current thread.  A
previous call to sqleAttachToCtx() for that context must have been
made.

pCtx is expected to be a valid context previously allocated by
sqleBeginCtx().

This API has no effect on platforms where application threading is not
supported.


8.2.5.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1441 - invalid parameter
    -   -1442 - context not in use


8.2.6  sqleGetCurrentCtx()

    int sqleGetCurrentCtx(void ** ppCtx,
                          void * reserved,
                          struct sqlca * pstSqlca)

This returns the current context associated with a thread.

This API has no effect on platforms where application threading is not
supported.


8.2.6.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1219 - private memory could not be allocated
    -   -1441 - invalid parameter
    -   -1442 - context not in use


8.2.7  sqleInterruptCtx()

    int sqleInterruptCtx(void * pCtx,
                         void * reserved,
                         struct sqlca * pstSqlca)

This call interrupts the specified context.

pCtx is expected to be a valid context previously allocated by
sqleBeginCtx().

During processing, this call switches contexts to the one passed in,
sends the interrupt, then switches back to its original context before
exiting.

This API has no effect on platforms where application threading is not
supported.


8.2.7.1  Return codes

o   -1 - bad sqlca
o    0 - check the sqlca for the sqlcode.  The most common ones
    returned for this API are:
    -   0 - success
    -   -1219 - private memory could not be allocated
    -   -1360 - thread cannot be interrupted
    -   -1441 - invalid parameter
    -   -1442 - context not in use


8.3  Quick Guide to Using the SOCKS Enabled DB2 Client


8.3.1  Requirements

This interface is designed for use with the IBM NetSP Secured Network
Gateway V1.2 firewall server product.


8.3.2  Environment Variables

The following environment variables are mandatory and MUST be set to
enable SOCKS:

SOCKS_NS       This is your Domain Name Server for resolving the host
               address of your SOCKS server.  This should be an IP
               address.

SOCKS_SERVER   This is either the fully qualified hostname or the IP
               address of your SOCKS server.  Note that if the SOCKS
               enabled DB2 client is unable to resolve your fully
               qualified hostname it will assume that an IP address
               has been entered.

               Your SOCKS_SERVER should be reachable via the SOCKS_NS
               domain server OR it should be in your /etc/hosts file
               OR it should be in an IP address format.

If you are using the command line processor and you have set these
environment variables after issuing a 'db2start', issue a DB2
TERMINATE at the command-line.


8.3.3  Using SOCKS via the command line processor:

1.  To catalog a SOCKS node, catalog your node as a TCP/IP node, but
    add a new SECURITY option to specify whether you will be using
    SOCKS for that node.

   +-----------------------------------------------------------------+
   |                                                                 |
   |  >>--CATALOG TCPIP NODE--nodename--REMOTE--hostname-----------> |
   |                                                                 |
   |  >--SERVER--service-name--.----------------.------------------> |
   |                           '-SECURITY SOCKS-'                    |
   |                                                                 |
   |  >--.------------------------.------------------------------->< |
   |     '-WITH--"comment-string"-'                                  |
   |                                                                 |
   +-----------------------------------------------------------------+

    Example:

    a.  To catalog a TCP/IP node that will NOT be SOCKS-enabled, with
        the nodename of NOSOCKS, hostname of DB2SERV, and service-name
        of TCP_DB2SERV, enter the following:

            CATALOG TCPIP NODE NOSOCKS REMOTE DB2SERV SERVER TCP_DB2SERV

    b.  To catalog a TCP/IP node that will be SOCKS-enabled, with the
        nodename of YESSOCKS, hostname of DB2SERV, and service-name of
        TCP_DB2SERV, enter the following:

            CATALOG TCPIP NODE YESSOCKS REMOTE DB2SERV SERVER TCP_DB2SERV
            SECURITY SOCKS

        NOTE:  Note that you have to enter security socks to enable
               this support!

2.  To check which of your nodes are enabled for SOCKS, enter the
    following command:

             LIST NODE DIRECTORY

    Note that this command has not changed.  However when listing node
    information, for TCP/IP nodes that have SECURITY SOCKS enabled,
    the node information will have an extra line with the information
    SECURITY = SOCKS.  For non-SOCKS-enabled nodes, no line will be
    displayed for SECURITY.

3.  Once your node is cataloged, catalog your database as you normally
    would.  No changes have been made to this command.

4.  Connect to your database using the standard CONNECT statement.
    Once you have connected successfully to your database, it should
    be business as usual.


8.3.4  Using SOCKS via the CATALOG NODE API (sqlectnd):

Check your DB2 API Reference for the usage of this API.

1.  API Syntax

    The overall syntax of the sqlectnd API remains as follows:

    C API Syntax

             ____________________________________________________
            |                                                    |
            |  /* File: sqlenv.h */                              |
            |  /* ... */                                         |
            |  SQL_API_RC SQL_API_FN                             |
            |    sqlectnd (                                      |
            |          struct sqle_node_struct * pNodeInfo,      |
            |          void * pProtocolInfo,                     |
            |          struct sqlca * pSqlca);                   |
            |  /* ... */                                         |
            |____________________________________________________|

    Generic API Syntax

             ____________________________________________________
            |                                                    |
            |   /* File: sqlenv.h */                             |
            |   /* ... */                                        |
            |   SQL_API_RC SQL_API_FN                            |
            |     sqlgctnd (                                     |
            |           struct sqlca * pSqlca,                   |
            |           struct sqle_node_struct * pNodeInfo,     |
            |           void * pProtocolInfo);                   |
            |   /* ... */                                        |
            |____________________________________________________|

    API Parameters

    PSQLCA         Output.  A pointer to the sqlca structure.

    PNODEINFO      Input.   A pointer to a node directory structure.
                   For more information about this structure, see
                   "SQLE-NODE-STRUCT" below.


    PPROTOCOLINFO  Input.   A pointer to the protocol structure.  See
                   "SQLE_NODE_TCPIP" below.

2.  SQLE_NODE_STRUCT

    A new communications PROTOCOL type has been created for use in
    cataloging a TCP/IP SOCKS node as follows:

         SQL_PROTOCOL_SOCKS
            TCPIP using SOCKS

    To catalog a SOCKS node, simply set the PROTOCOL type in the node
    directory structure to SQL_PROTOCOL_SOCKS before invoking the API.

         _____________________________________________________________________
        | Fields in the SQLE-NODE-STRUCT Structure                            |
        |_____________________________________________________________________|
        | Field     | Data     | Description                                  |
        | Name      | Type     |                                              |
        |___________|__________|______________________________________________|
        | STRUCT_ID | SMALLINT | Structure identifier.                        |
        |           |          |                                              |
        |___________|__________|______________________________________________|
        | CODEPAGE  | SMALLINT | Code page for comment.                       |
        |           |          |                                              |
        |___________|__________|______________________________________________|
        | COMMENT   | CHAR(30) | Optional description of the database.        |
        |           |          |                                              |
        |___________|__________|______________________________________________|
        | NODENAME  | CHAR(8)  | The name of the node where the database is   |
        |           |          | located.                                     |
        |___________|__________|______________________________________________|
        | PROTOCOL  | CHAR(1)  | Communications protocol type.                |
        |           |          |                                              |
        |___________|__________|______________________________________________|
        | Note:  The character fields passed in this structure must be null   |
        | terminated or blank filled up to the length of the field.           |
        |_____________________________________________________________________|

       C Structure

             ___________________________________________________________
            |                                                           |
            |   /* File: sqlenv.h */                                    |
            |   /* ... */                                               |
            |   SQL_STRUCTURE sqle_node_struct                          |
            |   {                                                       |
            |           unsigned short struct_id;                       |
            |           unsigned short codepage;                        |
            |           char           comment"SQL_CMT_SZ + 1];         |
            |           char           nodename"SQL_NNAME_SZ + 1];      |
            |           unsigned char  protocol;                        |
            |   };                                                      |
            |   /* ... */                                               |
            |___________________________________________________________|

     COBOL Structure

             ___________________________________________________________
            |                                                           |
            |     * File: sqlenv.cbl                                    |
            |     ** ....                                               |
            |      01 SQL-NODE-STRUCT.                                  |
            |          05 STRUCT-ID              PIC 9(4) COMP-5.       |
            |          05 CODEPAGE               PIC 9(4) COMP-5.       |
            |          05 COMMENT                PIC X(30).             |
            |          05 FILLER                 PIC X.                 |
            |          05 NODENAME               PIC X(8).              |
            |          05 FILLER                 PIC X.                 |
            |          05 PROTOCOL               PIC X.                 |
            |          05 FILLER                 PIC X(1).              |
            |     ** ....                                               |
            |___________________________________________________________|

3.  SQLE_NODE_TCPIP

       SOCKS nodes use the same protocol structure as regular TCP/IP
    nodes.
       All data requirements are the same for both types of nodes.

         _____________________________________________________________________
        | Fields in the SQLE-NODE-TCPIP Structure                             |
        |_____________________________________________________________________|
        | Field Name   | Data Type | Description                              |
        |______________|___________|__________________________________________|
        | HOSTNAME     | CHAR(255) | The name of the TCP/IP host on which the |
        |              |           | DB2 server resides.                      |
        |______________|___________|__________________________________________|
        | SERVICE_NAME | CHAR(14)  | TCP/IP service name of the DB2 server.   |
        |______________|___________|__________________________________________|

       C Structure

             ___________________________________________________________
            |                                                           |
            |   /* File: sqlenv.h */                                    |
            |   /* ... */                                               |
            |     SQL_STRUCTURE sqle_node_tcpip                         |
            |     {                                                     |
            |              char     hostname"SQL_HOSTNAME_SZ+1];        |
            |              char     service_name"SQL_SERVICE_NAME_SZ+1];|
            |     };                                                    |
            |   /* ... */                                               |
            |___________________________________________________________|

    COBOL Structure


             ___________________________________________________________
            |                                                           |
            |   * File: sqlenv.cbl                                      |
            |   ** ....                                                 |
            |   01 SQL-NODE-TCPIP.                                      |
            |       05 HOSTNAME               PIC X(255).               |
            |       05 FILLER                 PIC X.                    |
            |       05 SERVICE-NAME           PIC X(14).                |
            |       05 FILLER                 PIC X.                    |
            |  ** ....                                                  |
            |___________________________________________________________|


8.3.5  Troubleshooting

To debug simple problems, use the DB2DIAG.LOG file for your instance.
To obtain the maximum amount of information, issue the following
command before issuing a db2start.

     DB2 UPDATE DBM CFG USING DIAGLEVEL 4

This will include error, warning and informational messages in
DB2DIAG.LOG.  In particular this log file should indicate whether the
connect failed when trying to connect to the SOCKS firewall server or
the DB2 target server.


8.3.6  Restrictions

The SOCKS option is only supported through the command line processor
or APIs.  You cannot use the Client Setup Utility or the Database
Director to set this option.


8.3.7  The IBM NetSP Secured Network Gateway V1.2 (SOCKS) Server

NOTE:  This section may be most relevant for the firewall
       administrator.

1.  Make sure that your sockd.conf file has an entry permitting the
    DB2 client to connect to the target server.

    a.  For UNIX, your sockd.conf must include the IP address of the
        DB2 client, but does not need to include the source logged-on
        user ID at the DB2 client unless you specifically want to
        permit connections based on both the user ID and the IP
        address.  There is no default source logged-on  user ID for
        UNIX. User IDs on UNIX may be case-sensitive, and should be
        entered in the sockd.conf file in their original case.

    b.  For OS/2, your sockd.conf must include the IP address of the
        DB2 client, but does not need to include the source logged-on
        user ID at the DB2 client unless you specifically want to
        permit connections based on both the user ID and the IP
        address.  The default source logged-on user ID for OS/2 is
        'OS2USER'.

    c.  For Windows 3.1, Windows 95, and Windows NT, your sockd.conf
        must include the IP address of the DB2 client, but does not
        need to include the source logged-on user ID at the DB2 client
        unless you specifically want to permit connections based on
        both the user ID and the IP address.  Typically for Windows
        3.1 the default source logged-on user ID is 'WINUSER'.  For
        Windows NT it is 'NTUSER'.

2.  Make sure that your SOCKS daemon, sockd, has been started at your
    SOCKS server.  Refer to the "IBM NetSP Secured Network Gateway
    V1.2 Installation, Configuration and Administration Guide' for
    details on configuring and starting the sockd daemon.

    NOTE:  The Secured Network Gateway product is only available on
           AIX.

3.  Check your messages file, in /var/adm/messages, if any problems
    occur or if you want to look at audit information.


8.4  CREATE IN DATABASE

All "CREATE TABLE" statements will have an "IN DATABASE <dbname>"
statement appended to the end if:

o   The connection is to DB2 for MVS.
o   The statements are issued through the ODBC driver.
o   The db2cli.ini keyword DBNAME is set (to <dbname>)
o   There is no "IN DATABASE" clause in the original SQL "CREATE
    TABLE" statement.


8.4.1  Deferred Prepare Support for ODBC/CLI Applications

Deferred Prepare is a performance enhancement for the ODBC/CLI
application.  This can be enabled or disable with a new configuration
parameter DEFERREDPREPARE=0 (disable) or 1 (enable) in the DB2
ODBC/CLI configuration file (DB2CLI.INI).  By default it is disabled
for the refresh.

When Deferred Prepare is enabled, the DB2 client will defer the
processing of the SQL Prepare request until the corresponding SQL OPEN
or EXECUTE is issued.  This is especially beneficial when a remote
database is accessed where the network flow for the two requests can
be combined.  This is an internal optimization that is transparent to
ODBC applications and does not require any application changes.

The following are considerations for enabling Deferred Prepare:

o   If you are using PeopleSoft, you should enable Deferred Prepare
    (DEFERREDPREPARE=1) and disable Cursor Hold (CURSORHOLD=0) for
    maximum performance.

o   If you are using SAP or BAAN, where their server ODBC applications
    PREPARE large number of statements ahead of time but won't Execute
    or Open the prepared statement until much later when a client
    application requests them, then there may not be any advantage in
    enabling Deferred Prepare.  The startup of the Server application
    will be faster, but the first execution of the actual SQL query
    might be slower.  Subsequent execution of the same query will have
    no difference.

o   For most ODBC application, enabling Deferred Prepare will increase
    performance by cutting down on the network flow of sending out the
    Prepare and Open/Execute separately.

o   Enabling Deferred Prepare will also defer the checking of the
    Optimization Estimate (DB2ESTIMATE=nn) until a cursor is opened
    instead of when it is prepared.

o   Deferred Prepare is disabled internally for SQL statements that
    reference the file descriptors of LOB data.


8.5  Support for Redirected Restore

A new command, SET TABLESPACE CONTAINERS, has been added to the
command line processor.  Also, new options have been added to the
RESTORE DATABASE command.  These changes enable you to perform the
redirected restore using the command line processor instead of writing
a program that calls the SET TABLESPACE CONTAINERS (sqlbstsc) API.

A redirected restore is a restore in which a set of table space
containers to contain the restored database is different from the one
of the original database at the time the backup was done.  This new
command allows you to add, change or remove table space containers for
a database that is to be restored.  For example, if one or more
containers are inaccessible for any reason, the restore will fail if
it is not redirected to different containers.

NOTE:  Redirected restore is not allowed when a user exit program is
       used to perform the restore.


8.5.1  The SET TABLESPACE CONTAINERS Command

COMMAND SYNTAX

    SET TABLESPACE CONTAINERS FOR tablespace-id
      [{REPLAY | IGNORE} ROLLFORWARD CONTAINER OPERATIONS]
      USING ( {PATH 'container-string' [{, PATH 'container-string'}...] |
              {FILE | DEVICE} 'container-string' number-of-pages
              [{, {FILE | DEVICE} 'container-string' number-of-pages}...]} )

COMMAND PARAMETERS

FOR TABLESPACE-ID
          An integer that uniquely represents a table space used by
          the database being restored.

{REPLAY | IGNORE} ROLLFORWARD CONTAINER OPERATIONS
          If REPLAY ROLLFORWARD CONTAINER OPERATIONS is specified
          (this is the default action), any ALTER TABLESPACE operation
          issued against this table space since the database was
          backed up will be redone during a subsequent roll forward of
          the database.

          If IGNORE ROLLFORWARD CONTAINER OPERATIONS is specified, the
          ALTER TABLESPACE operations in the log will be ignored when
          performing a roll forward.

USING ( PATH 'CONTAINER-STRING', ... )
          For a SMS table space, identifies one or more containers
          that will belong to the table space and into which the table
          space's data will be stored.

          The container-string is an absolute or relative directory
          name.  If the directory name is not absolute, it is relative
          to the database directory.  The container-string cannot
          exceed 240 bytes in length.

USING ( {FILE | DEVICE} 'CONTAINER-STRING' NUMBER-OF-PAGES, ... )
          For a DMS table space, identifies one or more containers
          that will belong to the table space and into which the table
          space's data will be stored.  The type of the container
          (either FILE or DEVICE) and its size (in 4K pages) are
          specified.  A mixture of FILE and DEVICE containers can be
          specified.  The container-string cannot exceed 254 bytes in
          length.

          For a FILE container, the container-string must be an
          absolute or relative file name.  The file name, if not
          absolute, is relative to the database directory.

          For a DEVICE container, the container-string must be a
          device name.  The device must already exist.


8.5.2  The Changes to the RESTORE DATABASE Command

COMMAND SYNTAX

   RESTORE DATABASE source-database-alias { restore-options | CONTINUE | ABORT }

 restore-options:
 [USER username [USING password]] [TABLESPACE ONLINE | HISTORY FILE] [USE ADSM
 [OPEN num-sess SESSIONS] | FROM dir/dev [ {,dir/dev} ... ] | LOAD shared-lib
 [OPEN num-sess SESSIONS]] [TAKEN AT date-time] [TO target-directory]
 [INTO target-database-alias] [WITH num-buff BUFFERS] [BUFFER buffer-size]
 [REPLACE EXISTING] [REDIRECT] [WITHOUT ROLLING FORWARD] [WITHOUT PROMPTING]

COMMAND PARAMETERS

The following parameters have been added: REPLACE EXISTING, REDIRECT,
CONTINUE and ABORT.

REPLACE EXISTING
          If a database with the same alias as the
          target-database-alias already exists, this parameter tells
          the restore utility to replace the existing database with
          the restored database.  This is useful when writing scripts
          containing the RESTORE DATABASE command, because the command
          line processor will not prompt you to instruct it whether
          the existing database should be deleted.  If you specify the
          WITHOUT PROMPTING parameter, there is no need to specify
          REPLACE EXISTING.  (However, WITHOUT PROMPTING does more
          than REPLACE EXISTING.  It will make the command fail in
          case there are any actions that would normally require user
          intervention.)

REDIRECT
          Specifies that the restore is a redirected one.  A RESTORE
          DATABASE command with this parameter is the first step of a
          redirected restore.  It should be followed by one or more
          SET TABLESPACE CONTAINERS commands, and finally by a RESTORE
          DATABASE command with the CONTINUE parameter.

CONTINUE
          Indicates to the restore utility that the containers have
          now been redefined and that the final step in the redirected
          restore should be performed.

ABORT
          Stops the redirected restore.  Useful in the case an error
          has occurred that would require one or more steps to be
          repeated.  After RESTORE DATABASE ...  ABORT has been
          issued, the entire set of steps of a redirected restore must
          be repeated, starting with a RESTORE DATABASE ...  REDIRECT
          command.

A TYPICAL REDIRECTED RESTORE SCENARIO:  Assuming that the database
alias of the database being restored is MYDB, a typical use of the
above commands would involve the following sequence of actions:

1.  Issue a RESTORE DATABASE command with REDIRECT parameter, for
    example:

          RESTORE DB MYDB REPLACE EXISTING REDIRECT

    NOTE:  Any time after a successful completion of step 1 and before
           issuing RESTORE DB MYDB CONTINUE (in step 3), you can abort
           the restore by issuing the following command:

                 RESTORE DB MYDB ABORT

2.  After a successful execution of step 1, issue a SET TABLESPACE
    CONTAINERS command for each tablespace whose containers must be
    redefined, for example:

          SET TABLESPACE CONTAINERS FOR 5 USING
             (FILE 'F:\TS3CON1' 20000, FILE 'F:\TS3CON2' 20000)

    To verify that the restored database's containers are the ones as
    specified in this step, use the LIST TABLESPACE CONTAINERS
    command.

3.  After a successful execution of steps 1 and 2, issue the command

          RESTORE DB MYDB CONTINUE

    which is the final step of the redirected restore.

4.  If step 3 has failed, or if you stopped the restore with RESTORE
    DB MYDB ABORT, you must start the redirected restore from step 1
    all over again.


8.6  NLS Additions

Code support for Latvia, Lithuania, and Estonia has been added to DB2
for OS/2 and DB2 for AIX V2.1.2. products.  The following tables list
the locales, code pages and date time formats for each country:

1.  For Country Code and Code Page Support tables:

        Locale  Code Set  Code Page  CountryCode   Country/Language
       -----------------------------------------------------------------------
        Lv_LV   IBM-921     921         371         Latvia/Latvian
        Lt_LT   IBM-921     921         370         Lithuania/Lithuanian
        Et_EE   IBM-922     922         372         Estonia/Estonian

    NOTE:  Note that the last two characters of locale name indicate
           territory.

2.  For Date and Time Formats table:

                     Local       Local      Default        Input
                     Date        Time       Output         Date
     Country code    Format      Format     Date Format    Formats
     -------------------------------------------------------------------------
     372 Estonia     dd-mm-yyyy   JIS       LOC            LOC, USA, EUR, ISO
     371 Latvia      yyyy.dd.mm   JIS       LOC            LOC, USA, EUR, ISO
     370 Lithuania   yyyy.mm.dd   JIS       LOC            LOC, USA, EUR, ISO


8.7  DB2 Support for Java Code Development

You can now develop Java applications and applets that access live
data from your DB2 databases!  With Version 2.1.2, DB2 adds support
for the Sunsoft Java Database Connectivity (JDBC) APIs for database
access.  JDBC APIs are similar to ODBC APIs, providing a standard way
of accessing databases from Java code.

DB2 provides a JDBC driver to handle JDBC API calls from the
client Java code. You can use this support to build both:

o   Java applications, which rely on the DB2 Client Application
    Enabler (CAE) to connect to DB2.
o   Java applets, which do not require any other DB2 component code on
    the client.

Add this to Java's portability, and you have the potential to deliver
DB2 access to clients on multiple platforms, requiring only a
Java-enabled web browser!

DB2's Java support is available on the following platforms:

o   Windows NT 3.51 or later
o   Windows95
o   OS/2 Warp 3.0 or later
o   AIX 3.2.5 (applet server only), and 4.1 or later
o   Solaris 2.5 or later.

For more information about developing DB2 applications in Java, see
DB2JAVA.HTM (HTML version) or DB2JAVA.TXT (flat text).  You can find
these files in the SQLLIB directory where DB2 is installed.


9.  Miscellaneous

9.1  DB2 Family Newsletter

For the latest information about the DB2 family of products, you may
subscribe to the "DB2 Family Newsletter" (English only).  Simply send
your request in a FAX to 1-905-316-4733, and include the following
information:

    Name
    Company name
    Full mailing address
    Telephone number
    DB2 products you currently use

  -------------------------------------------------------------------

  *  are trademarks or registered trademarks of IBM Corporation.

  ** are trademarks or registered trademarks of their respective owners.

  -------------------------------------------------------------------

  ***********************************************************************
  **                                                                   **
  **  (c) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1996.  **
  **                    ALL RIGHTS RESERVED.                           **
  **                                                                   **
  ***********************************************************************
23695       124616      2490        901226757   2379        200         644         7   fixinfo `
********************************************************************
 Product Name : DB2 Database Server for AIX 
 Package Name : U458629 
 Packaged By  : Paul Lee
 Package Date : Fri Jul 17 10:30:54 EDT 1998
 Build Level  : c980627 
********************************************************************
APAR No.  Abstract
--------  ----------------------------------------------------------
IX60403   CALL TCP/IP _R FUNCTIONS
IX64284   FP UNDERFLOW (TOO MANY PREDS) CAUSES BAD PLAN
JR09106   INCORRECT UPDATE OF DB2/6000 LOGFILSIZ FROM DB2DD/2
JR09200   SQL0444N (-444) FROM AS/400 EXECUTING STORED PROCEDURE
JR09350   RESTORE GOT DBABG.EXT ACCESS VIALATION 0X00000005
IX60015   SQLURLOG_API (ASYNS LOG READ API) RETURNS WITH AN SQL2657N INCORRECTLY WHEN IT SHOULD NOT.
IX60737   DUMP OSS RC CALLED FROM LOAD UTILITY WHEN REMOTE FILE IS OPENED.
IX60794   DB2/6000 V2.1 BACKUP WILL LEAVE 2 IPCS AFTER COMPLETING.  ONE IS A SEMAPHORE, AND THE OTHER IS A MESSAGE QUEUE.
JR09268   CREATING AN EVENT MONITOR IN DB2/NT V2.1.1 FROM THE CLP DOES NOT ACCEPT THE WINDOWS/NT SYNTAX FOR A LOCAL NAMED PIPE.
IX61036   PREP COBOL APP. WHICH HAS $SET GENRATES SQL4001
IX61101   BACKUP TO ADSM SHOULD UPDATE FILESPACE, IF IT ALREADY EXISTS
IX61129   MEMORY LEAK IN LONG RUNNING CLP DOING REPEATED UDF REFERENCES IN DB2/6000 V2.
JR09307   DB2/2 V2.1 REXX API 'GET RECOVERY HISTORY FILE ENTRY' FAILS WITH SQL2165W ERROR IF BACKUP ENTRY CONTAINS MORE THAN 4 TABLESPACES.
JR09291   DB2 ODBC DRIVER CAUSES SQLTABLE TO USE TABLE SCAN ON DB2/MVS THUS  RESULT IN PERFORMANCE PROBLEM
JR09292   UPDATE BASED ON DATE FIELD FAILS FROM ODBC APPLICATIONS
JR09293   HANG DURING EXPORT
IX61923   EXPORTING LOB FILES EXCEEDS 1000.
JR09314   THE PROBLEM IS DUE TO THE CONNECTION ACCESS MODE BEING CHANGED TO READ_ONLY.
JR09226   GRAPHIC DATA TYPE PROBLEMS WITH ODBC FROM MS ACCESS
JR09319   CLOB FIELD RETURN INCORRECT LENGTH ON 0 LENGTH STRING WHEN SQLBIND IS + 1 OF THE ACTUAL LENGTH OF THE CLOB
JR09339   LOGIC ERROR IN SQLE_DB2RA_AS_HOPDRIVER_FREE
IX62442   CLEAN UP ERROR PROCESSING FOR NON-ATOMIC ARRAY PROCESSING WHEN PROCESSING IN CLI
IX62275   DB2STOP HANGS INTERMITTENTLY ON AIX 3.2.5 OR 4.1.4
IX62287   DB2/6000 V2.1.1 - QUERY USING CORRELATED SUBQUERY ON ONE TABLE WITH INDICES IS RETURNING WRONG NUMBER OF ROWS IN RESULT SET.
JR09376   16 BIT APPLICATIONS CAUSE PAGE FAULT WHEN DOING SQLCONNECT A INVALID DSN LENGTH IS SENT TO US.
JR09380   OFFLINE BACKUP SHOULD NOT COMPLETE WITH MISSING TABLE DAT FILES.
IX62442   CLEAN UP ERROR PROCESSING FOR NON-ATOMIC ARRAY PROCESSING WHEN PROCESSING IN CLI
JR09399   HISTORY FILE IS NOT UPDATED AFTER DATABASE BACKUP TO TAPE USING SAMPLE USEREXIT.
IX62424   APPENDING TO BLOB COLUMNS FAILS WITH SQL0902 RC=110
IX62454   PAGE CLEANERS FLOOD THE DB2DIAG FILE AND DB2 HAS TO BE STOPPED.
IX62464   BINDING TO A BLOB COLUMN CAUSES SEGMENTATION FAULT.
IX62502   DB2STOP HANGS WHEN DATABASE PREVIOUSLY ACTIVATED
JR09419   COUNTRY CODE FOR SLOVENIA IS NOT SUPPORTED IN DB2/NT
IX62910   DB2 LOST CONNECTION FROM CICS APPLICATION SERVER CAUSES CICS REGION TO CRASH.
JR09425   SQL/DS RETURNS -515 ON COMMIT
JR09426   CONVERTING FROM ASCII TO FLOAT ON DB2/NT IS DEPENDANT ON THE LOCALE.  IMPORTING A ASCII FILE TO A FLOAT COLUMN FAILS (SPAIN)
IX62813   RESTORE FROM TAPE TRAPS
JR09435   SQL30073 RC 0010 FROM AR IF APP USES FIXCHAR WITH LENGTH >254
JR09436   DDCS/2 GATEWAY SYS3175 NETAPI.DLL WITH SECURITY SAME
JR09443   DB2 CLI ODBC DRIVERS TRUNCATE DIGITS AFTER DECIMAL POINT ON CLIENTS WHICH USES COMMA AS THE DECIMAL POINT
JR09467   CLI0102E INVALID CONVERSION ERROR ON SQLFETCH FOR AN SQLTABLES CALL WHEN GOING TO THE AS400.
JR09442   SQL_SUCCESS_WITH_INFO FROM SQLFETCH USING MS ACCESS. TABLE ON THE DB2/MVS SYSTEM WHICH HAS MORE THEN 22 FIELDS.  DUPLICATE ROW
IX62759   PROBLEM WITH DB2LOOK TOOL IN DB2/6000 V2.1.1.  MIMIC OPTION IS NOT HANDLING UNIQUE INDEXES AND PRIMARY KEYS PROPERLY.
JR09454   IMPROVE MIGRATE DIAGNOSTICS.
IX62897   8 TABLE JOIN TOO BUSHY AT OPTIMIZATION LEVEL 0 WHEN STATISTICS HAVE BEEN UPDATED.
IX57283   LONG FIELD DATA CORRUPTED WHEN MULTIPLE PROCESSES INSERTING LONG FIELD DATA INTO THE SAME TABLE
JR09477   EXPORT OF WSF FOR V1.2 AND V2.1 DIFFER IN THE CONTENTS OF THE FILE WHEN THE SUM FUNCTION IS PART OF THE SELECT STMT
JR09467   CLI0102E INVALID CONVERSION ERROR ON SQLFETCH FOR AN SQLTABLES CALL WHEN GOING TO THE AS400.
IX58313   DB2/6000 V211 ACTIVATE, BACKUP, RESTORE, CONNECT GIVES SQL1042
JR09319   CLOB FIELD RETURN INCORRECT LENGTH ON 0 LENGTH STRING WHEN SQLBIND IS + 1 OF THE ACTUAL LENGTH OF THE CLOB
JR09518   ON A SQLDRIVERCONNECT THE SECOND CONNECT WITH A SMALLER PASSWORD RETURNS AN INCORRECT PASSWORD. (APPENDS FIRST PASSWORD TO END)
IX64297   TEST
JR09616   PRECOMPILE OF COBOL SOURCE CODE WITH THOUSANDS OF HOST VARIABLES MAY CAUSE SQL0083C ERROR.  NEED TO INCREASE THE MEMORY POOL.
JR09686   CONNECTION FROM WINDOW SUPPORT FAILS LOOKING FOR DB2CPICW.DLL
JR09694   TRAP IN DB2SQL1 IN SQLNQ_GET_BASE_FCS() FROM A SELECT FOR UPDATE ON A VIEW.
JR09852   SELECT DECIMAL (-1,1,0) FAILS IN CLI
IX62276   GETTING LIBDB2VES.A IS UNDEFINED WITH VISUAL EXPLAIN
JR09424   PRECOMPILE OF A COBOL APP WITH SDK/NT LEAVES OUT A . AT THE END OF THE CALL-CONVENTION LINE IF SPECIAL-NAMES IS DEFINED ALREADY.
JR09457   PREP ADDING "SPECIAL-NAMES" IN INCORRECT SECTION OF COBOL APP
IX62803   SIGNAL #11 IN SQLRCFDA DURING FREEING OF ACCESS ALLOCATIONS
IX63070   SDK FOR HP-UX V2 AND SUN V2 WILL NOT WORK BECAUSE NO DB2RTE.
JR09592   SQL_C_BINARY PASSED TO A STORED PROCEDURE GETS PROMOTED TO A SQL TYPES THAT MATCHES THE SIZE IGNORING THE TYPE IN BINDPARAMATER.
JR09698   BACKUP WITH USEREXIT GENERATES SQL2003, SQLCA -2024 ... 7B IN DOSOPEN - DEBUG DB2EUTIL.DLL MASKS PROBLEM
JR09862   SQLGETDATA() RC=S1004 & PCBVALUE WRONG IF CALLED WITH SAME COL#
IX65400   LOAD OF A LARGE DATASET WILL FAIL IN THE BUILD OR DELETE PHASE
IX65124   STORED PROCEDURE CORRUPTS A LARGE RETURN SQLDA
JR09886   -902 REPORTED BY SQLRARVP DURING RUNSTATS
IX65131   DEPENDENCIES INTRODUCED BY CORRELATION IN HXPS NOT WORKING OK   
IX65158   ONLINE BACKUP REMOVES THE LOCKS MADE BY QUIESCING AND THEN PUTS THEM BACK.
IX65185   DB2/6000 V2.1 TRAPS AFTER PREFETCHERS AND/OR PAGE CLEANERS CAN NOT BE ALLOCATED PROPERLY DURING FIRST DATABASE CONNECTION.
IX65188   UNABLE TO FORCE APPLICATIONS WHICH SHOW UP IN LIST APPLICATIONS
IX65191   CORE FILE GENERATED IN SQLORESOLVEADDRESS WHEN UDF RTRIM INVOKED
JR09901   ROLL FORWARD THROUGH THE LOGS GENERATES A TRAP IN DB2DMGR.DLL IN THE SQLICKEY FUNCTION
JR09914   CUMULATIVE COST AFTER NLJOIN IS TOO SMALL
JR09902   ODBC LOGON SCREEN DOES NOT GET PLACED AS THE FRONT WINDOW
JR09903   BIND SQL_C_TYPE '0' TO SQL_DECIMAL WITH SQLBINDPARAMETER() FAILS
JR09912   SQL3022 ON EXPORT FROM V1.2 CLIENTS THROUGH DDCS V2.3.2
JR09920   RECEIVE A CLI0112E STATE 22005 WHEN INSERTING FROM POWER BUILDER AND CAE/WIN-OS/2 2.1.1 811+
JR09917   CLIENT HANGS WHEN DOING A QUERY THREW DDCS TO MVS
JR09922   ADD #INCLUDE <STRING.H> TO SAMPLES\CLI\SAMPUTIL.C
JR09936   INCLUDE DEFECTS 56919,56923,57281,58767 INTO 2.1.2
JR09939   FILTER FACTOR FOR 'LIKE %' IS INCORRECT
JR09950   REXX API FOR CATALOG DATABASE USES AUTHENTICATION SERVER 
IX65422   JAVA LINKS NOT BEING CREATED DURING INSTANCE UPDATE AFTER UPGRADING TO DB2/6000 V2.1.2 FROM V2.1.1.
JR09951   PROBLEMS WITH CHINESE CODEPAGE TRANSLATION WHEN CODE PAGE IS SET TO 1381 ON OS/2 AND 1383 ON AIX
IX65659   BACKUP ON DB2/HP V2.1.2 FAILS.
IX65568   SQL0444 RETURNED ON USE OF RTRIM FUNCTION.  DB2CLIFN.A NOT FOUND
IX65614   INVALID MEMORY BLOCK DURING PREP IN THE DIAG FILE (SQL0083).
JR09984   DB2DD APPC CATALOG IN ERROR
IX65739   LIBDJRA.A IS NOT SHIPPED AND CONNECTS TO DOWNLEVEL SERVERS WILL FAIL WITH A SQL10013.
JR10064   SQLSTATISTICS CALL TO A MVS HOST THAT HAS A INDEX COLUMN NAME WITH DBCS IN IT CAUSE A SUBSTITUTION ERROR (01517)
JR10102   ADD FOR FETCH ONLY TO THE STATIC SCHEMA CALLS FOR DB2/400 AND DB2 MVS.
JR10105   DB2 VALUES CHAR('STRING',LENGTH('STRING')) GENERATES SQL0901 SHOULD GENERATE SQL0123
IX66149   SOUNDEX UDF IS RETURNING INCORRECT RESULTS IN DB2/6000 V2.1. DB2/2 V2.1 RETURNS THE PROPER VALUES.
IX66200   MEMORY THRESHOLD USED FOR THE AGENTPOOL
JR10137   POWER BUILDER ( POWERSOFT ) APPLICATION CAUSES A GPF IN DB2W.DLL
JR10147   TRAP IN DB2SYSC
IX67183   SQLPROCEDURECOLUMNS RETURNS A PRECISION OF 0 IF A PARAMETER IS DEFINED AS PARMNAME CLOB(1000)
JR10150   PROBLEM WITH MULTITHREADING IN THE CAE FOR SOLARIS
IC16687   CLIENT DOES NOT HANDLE OUTER JOIN
JR10169   SQLO_REMOVE_STATIC_DATA_ANCHORS IS NEVER CALLED ON NT
JR10304   SUPPORT FOR CODE PAGE 819 LATIN 1 IN CAE FOR OS/2
JR10183   -305 TO AN APPLICATION MAKING A REMOTE PROCEDURE CALL TO HOST SYSTEM DUE TO MISHANDLING OF INDICATOR VALUE. DDCS
JR10203   QUALIFIER SUPPLIED TO SQLTABLES CALL ARE IGNORED
IX66817   LOAD LARGE TABLE WITH INDEX TRAPED IN SQLU_SBGETPG (SIG. 11)
JR10212   PERFORMANCE PROBLEM WITH SQLCOLUMNS CALL AGAINST DB2/400
IX66913   PERIODIC SQL0902 RC 24 (INCORRECT TABLE HANDLE ENCOUNTERED) DUE TO WANDERING MEMORY OVERWRITE
JR10370   DBCS SUPPORT FOR JDBC ON JDK V1.02 ON OS/2
JR10208   TRIGGER RETURNS SQL100 FOR UPDATE INSTEAD OF SQL445.
IX67033   DB2ADUTL DELETE KEEP... INCORRECTLY DELETES LOGS
IX67077   SQL1227 WHEN UPDATING HIGH2KEY IN SYSSTAT.COLUMNS (SAP)
IX67093   FORKING AND CLI CALLS ON AIX CAN RESULT IN PROBLEMS FOR THE CHILD PROCESS.
JR10221   BUG IN THE ERROR LOGGING PATH
JR10234   AUSTRIAN CODE PAGE SUPPORT REQUIRED IN DB2 V2
JR10303   SQL0902C WITH RC = 70 ON THE CLIENT WHEN A LARGE AMOUNT OF DATA IS BEING RECEIVED FROM THE SERVER
IX67258   DB2 THINKS APPLICATION IS MULTI THREADED
IX67291   DB2 2.1.2 COMMAND LINE REDIRECTED RESTORED WITHOUT PROMPTING TRAPS IMMEDIATELY WITH A SQL1224
IX67296   -1042C LANG=JA_JP-ACTIVATE DB FOLLOWED BY DB2STOP LEAVES DANGLING PROCESSES AND LEADS TO NEXT CONNECTION TO DB FAILS.
IX67302   TRAPPING DOING ADSM BACKUP IN WALK_LIB.   
IX67307   ODBC/CLI PERFORMANCE IMPROVEMENTS IN V2.1.2
JR10299   SQLTABLES CALL ON A SYSTEM TABLE THAT HAS A SYSSCHEMA THE SAME AS THE TABLE CREATOR THE TABLE TYPE WILL BE SYSTEM TABLE
IX67436   DB2/6000 V2.12 HANGS
IX67458   CURRENT TIMESTAMP RETURNED BY DB2/6000 V2.1 INCORRECT WHEN THE MICROSECOND PORTION SUPPOSED TO BE ALL ZEROS.  ONLY ON 604-SMP.
JR10312   RESTORE OF DB2 V2.1.2 DATABASE FAILS WITH AN SQL0902C, RC=72 ERROR.
IX67484   TRAP ON EXIT OF A FORKED CHILD DUE TO THE INTERRUPT HANDLER TRYINT TO CLEANUP INVALID CTX'S FROM INHERITED FROM PARENT
JR10328   RUNNING MORE THAN ONE USEREXIT AT THE SAME TIME WILL CAUSE ONE TO HANG.
JR10347   SQLCANEL FAILS WITH -1 WHEN EXECUTED.  SQLERROR CALL RETURNS NO ERROR.
IX67732   FIX VARIOUS PROBLEM FOUND BY A CUSTOMER
JR10387   SQL0902N RC 81 RUNNING DDCS/2 APP AGAINT DB2/VM AND DB2/VSE 5.1.0
IX67750   CLP TOKEN SIZE SHOULD BE >1024
IX67774   DDCSTRC ON -L 8000000 ... INCORRECT SYNTAX (MISSING = SIGN) WILL CAUSE A CORE DUMP ON LANG=JA_JP
JR10406   A NUMBER OF JDBC FIXES
IX67838   POOR LOGGING LOGIC WITH LOGRETAIN + USEREXIT
IX67875   DB2DD FAILS MOUNTING CONTAINERS TO A NEW VOLUME GROUP
IX67928   MEMORY LEAK WHEN USING CLI
JR10446   MS-QUERY RETURNS SQL0104N ERROR WHEN TRYING TO SELECT AGAINST DB2/MVS 3.1
JR10405   A QUERY AGAINST A VIEW IN DB2 COMMON SERVER V2.1.2 FAILS WITH AN SQL0901N ERROR, REASON = 'OID IMBALANCE'.
JR10462   DDCS/NT GATEWAY TRAP WITH DB2SYSC.EXE WHEN VOLUME IS HIGH
JR10473   SQL2044 RC 4 ON FAILING LOAD.  INVALID MESSAGE RECEIVED FROM A MESSAGE QUEUE.
IX68173   SQLCOLUMNS CALL RETURN INCORRECT RESULTS FOR USER DEFINED TYPES.
JR10474   SETTING SQLSTATE FIELD OVERWRITES SOMEOTHER FIELD IN MEMORY.
JR10480   WHEN INSERTING A SET OF ROWS USING ODBC AND SQLPREPARE AND SQLEXECUTE A TRAP IN DB2SYSCS.EXE
IX68236   TIMESTAMP GROWS WITH HIGH # OF CONNECTIONS
JR10504   SQLTABLES CALL WITH A (NOT NULL/ZERO LENGTH STRING) CATALOGNAME CAUSES AND ERROR.
JR10517   SQLPUTDATA RETURN -1 WITH VALID POINTER OF 0 LENGTH INPUT
IX68370   CLI0131E ERROR WHEN TRYING TO 'EDIT QUERY'  TO DB2/6000.
JR10519   DB2 MEMORY LEAK WITH FENCED UDF CALLS
IX68406   DB2 INSTALL FAILS ON SINIX 5.43 AND HIGHER
JR10586   TRAP IN DB2PGIXT, DURING LOGGING RELATED: WIN95 NOT RECOGNIZING 'CMD.EXE' EXECUTABLE
IX68441   INSERTING INTO DB2 V2.1.2 TABLE GIVES SQL0901N, REASON = 'COLUMN NUMBER OUT OF RANGE'.  DUPLICATE COLUMNS EXIST IN COLUMN LIST.
JR10612   RETURN ONLY UNIQUE ROWS FROM SYSIBM.SYSPROCEDURES WHEN CONNECTED TO DB2 FOR MVS.
JR10608   IMPORT FROM SDK/WIN31 V210 FAILS WITH SQL3011C: NOT ENOUGH STORAGE TO PROCESS THE COMMAND.
JR10602   TRAP IN SQLNG_PROCESS_PARSE_TREE() DURING A PREP DB2 V2
JR10615   TRANSACTION LOGGING CODE IGNORES SERIOUS ERROR
JR10607   TRAP IN DB2ASP0.DLL (NOTE, TRAP SCREEN SHOWS DB2SYSC)
IX68677   DB2/6000 V2.1.2 DATABASE ROLLFORWARD FAILS WITH SQL1224N ERROR. TRAP FILE SHOWS A SIGNAL #11 IN SQLDX_WRITE_PARTIAL_PAGE().
IX68682   LIST TABLESPACES FREE PAGES NOT UPDATED FOR DMS TABLES AFTER DROP TABLE.
JR10460   VARCHAR/LONG VARCHAR ARE NOT SUPPORTED IN FORTRAN - NEED TO ADD THIS SUPPORT
IX73231   QUERY WAS GETTING VERY BAD PERFORMACE IN A QUERY WHEN RUNSTATS FOR A TABLE WAS RUN WITH DISTRIBUTION.
IX61374   CICS/6000 TERMINATES AFTER BAD XACLOSE USING DDCS/6000
IX62913   DISK FULL MESSAGE WHEN OPENNING LOG FILE NEED CORRECT OS RC.
JR09881   INCONSISTENT RESULTS FROM THE DB2DART TOOL
JR10020   'CONNECT TO :NULLSTRING' BEHAVIOUR HAS CHANGED BETWEEN DB2 V1.X AND DB2 V2.1.  THE BEHAVIOUR IN V1.X IS CORRECT.
JR10121   SQL0001 DURING ACTIVATE DB AFTER A CONNECTION TO THE DB WAS ESTABLISHED FROM A DIFFERENT SESSION.
JR10162   ACCESS PLAN FOR CERTAIN QUERIES DOES NOT USE A TEMP TABLE (AS WAS DONE IN V1) WHICH PRODUCES BAD PERFORMANCE VS V1.
JR10218   MIGRATE DBASE FROM V1 TO V2 FAILS IF MAXAPPL OR MAXLOCK < 100
JR10370   DBCS SUPPORT FOR JDBC ON JDK V1.02 ON OS/2
JR10324   BACKUP OPERATION NOT RELEASING ALL MEMORY ONCE COMPLETED CAUSING RANDOM TRAPS IN DB2 AFTER A BACKUP
JR10327   V2 ONLY: RETROFIT OPTIMIZE FOR N ROWS FIXES TO V2
JR10336   SYS3175 TRAP IN DB2APP.DLL DURING AN EMBEDDED SQL CONNECTION ATTEMPT IN DB2/2 V2.1.2.  SQLASTRT IS THE FUNCTION ABENDING.
JR10404   CHANGE OF DATABASE AT THE USERID AND PASSWORD PROMPT OF THE DB2 DRIVER DOES NOT TAKE EFFECT.
JR10479   TRAP IN DB2 WHEN NON DB2 DATA IS WRITEN TO OUR TCPIP PORTS. THE TCP/IP INTERUPT PORT IS THE FAILING ONE
IX68437   PASS ENVIRONMENT VARIABLES THROUGH TO STORED PROCEDURE.
IX68697   SQL0298 ON COMMAND LINE REDIRECTED RESTORE DB2/AIX 2.1.2
JR10751   SYS3175 TRAP DURING A DATABASE CONNECTION (RESTART).  PRIOR TO THIS, A REORG TRAPPED LEAVING THE DATABASE INCONSISTANT.
JR10755   LOAD OF AN IXF FILE WILL CAUSE TRAP ON ANY OPERATING SYSTEM. AIX GIVES SIGNAL #4, OS/2 C0000005 IN SQLULIRA
IX69111   LOAD FAILS IN BUILD PHASE
JR10785   DB2STOP TRAPS IN DB2SYS.DLL ON WARP SMP WITH LOGRETAIN ON
IX70344   UABLE TO LINK A HP APP TO DB2
IX69332   WHEN INX PAGES GET CORRUPTED , DB2AGENT GOES INTO AN INFINITE LOOP.
JR10795   DB2 2.1.2 MAY INCORRECTLY UNDER-COST A PLAN AND CONSEQUENTLY CHOOSES A BAD PLAN
JR10834   SUPPORT FOR JDK V1.1
IX69549   DB2DD GOES INTO AN INFINITE LOOP BUILDING THE COLOR MAP
JR10835   SQL0305 (SQLSTATE 22002) RETURNED WHEN USING COGNOS DUE TO NULL INDICATOR VARIABLES NOT BEING SPECIFIED.
JR10837   BACKUP TO 0 GENERATES BLANK LINES IN .RST FILE THIS CAUSES TRP IN RESTORE FROM 0 (USEREXIT HAS ZIP COMMAND)
IX69610   JAPANESE CODE PAGES RESULT IN A CONVERSION ERROR MESSAGE IN THE DB2DIAG.LOG
JR10844   SQLNATIVESQL RETURNS MISPLACED RIGHT PARENTHESIS FOR CALL STMT
JR10848   TRAP IN DB2DARI.EXE WHEN SQLDBCON GETS NULLED OUT (IN SQLERIAR_CONNECT)
IX69111   LOAD FAILS IN BUILD PHASE
JR10876   LOGRETAIN NOT USING ALL AVAILABLE LOG SPACE
IX69806   HALF DATA RECD FOR DOUBLE BYTE COLS UNDER VB RDO.
IX67033   DB2ADUTL DELETE KEEP... INCORRECTLY DELETES LOGS
JR10834   SUPPORT FOR JDK V1.1
IX70033   SQLSETENVATTR WITH SQL_ATTR_OUTPUT_NTS NOT WORKING PROPERLY WHEN IT SET TO SQL_FALSE
IX70040   DBI1105W WHEN DOING A DB2IUPDT
JR10908   INVALID PARAMETER PASSED TO USER EXIT.
IX70279   UNABLE TO BREAK 64 GB BARRIER WHEN LOADING/IMPORTING LOB FIELDS.
JR10930   SQLP_ASYNCLOGREADAPI FAILURE USING DATAPROPAGATOR CAPTURE DUE TO LOG NOT BEING AVAILABLE.
IX70179   TAPE RESTORE FROM DB2/NT AFTER V2.1.2 GA FAILS. SQL2058W  AN END-OF-MEDIA.
IX70183   DB2 WILL HANG ON BACKUP IF 'WITHOUT PROMPTING' IS SPECIFIED AND THE BACKUP REACHS THE END OF THE TAPE.
JR10935   RESTORE USING USEREXIT IS CHANGING LOG PATH BACK TO DEFAULT
JR10940   'HIGH WATER MARK FOR DATABASE HEAP' IS NOT TRACKED CORRECTLY.
JR10963   RUNSTATS UPDATES CERTAIN VALUES INCORRECTLY.
JR10965   SQLSETCOLATTRIBUTES() PROBLEM WHEN STATEMENT HANDLE REUSED
IX67258   DB2 THINKS APPLICATION IS MULTI THREADED
JR10969   CONNECTIONS CREATED VIA HOPPING DO NOT GET CLEANED UP WHEN A REMOTE CLIENT REBOOTS
JR10973   GETASCIISTREAM TRAPS SERVER WHEN RETURNING ZERO LENGTH STRING
JR10975   LOAD TABLE FROM AN IXF ENCOUNTERED -3314N
JR10978   DB2DART DOES NOT CHECK FOR RECORD LENGTH=0
JR11011   JDBC PERFORMANCE ISSUES
JR11013   RESTORE VIA USEREXIT WITH DIFFERENT INSTANCE NAME FAILS
JR11025   SQLPRIMARYKEY/SQLFOREIGNKEY LOCKUP SYSTABLES IN AUTOCOMMIT MODE
JR11026   CLI0112E WHEN USING COMMA DELIMITED NUMBERS THROUGH ODBC DRIVER.
IX70903   CRASH RECOVERY COMPLETES BUT CODEPAGE MIXMATCH MARKS DB BAD.
JR11040   INVALID QUERY USING GROUP BY CLAUSE TRAPS ENGINE
JR11049   OBSOLETE DBMON TCB'S LEFT AFTER DATABASE PAUSE
IX71104   DB2BATCH CORE DUMPS WHEN USING -CLI AND -O WITH P > 1 EX: DB2BATCH -D SAMPLE -F <FILENAME> -O P 3 -CLI
JR11073   SQL0332N - CODEPAGE CONVERSION BETWEEN 500 AND 1275
IX71266   SQL10013 - ON SIXTH INVOCATION OF STORED PROCEDURE
JR11071   APPC LISTENER MUST BE RESTARTED WITH DB2STOP
JR11111   SYNC POINT MANAGER AUTHENTICATE USER INCORRECTLY
IX72355   A TRAP WITHIN A STORED PROCDURE IN SQLE_MRSP. DB2SYSC CORE DUMP
IX71625   CREATE DATABASE FAILS ON E30/AIX415 ON A LOB CHECK
IX71612   SQL0204 FOR IMPORT WITH REPLACE OPTION INTO A TABLE OWNED BY THE USER BUT IS NOT FULLY QUALIFIED IN THE IMPORT COMMAND
IX71837   USING FOR BIT DATA AND NORMAL CHAR TYPES IN A MERGE JOIN LEADS TO INCORRECT OUTPUT.
JR11337   SQL3401 SQLGIMP COBOL API DOES NOT IGNORE FILLER BYTES
IX71992   PROBLEMS DOING A PERFORMANCE MOVE OF LOG FILE WILL CREATE NEW
IX71996   LOAD INTO A TABLE ALIAS FAILS WHEN RETRIEVING COLUMN DEFAULTS
JR11208   TRAP AFTER MANY SEQUENTIAL BACKUPS
IX72125   DB2ADUTL TRIES TO EXTRACT BACKUP ARCHIVE WHEN IT'S ASKED FOR LOG ARCHIVES.
JR11261   DB2 COMMON SERVER - 'INTERSECT ALL' RETURNS TOO MANY ROWS.
JR11296   MEMORY LEAK IN JDBC APPLICATION DRIVER WITH SETSTRING/GETSTRING
JR11312   MEMORY OVERWRITTEN WHEN LOGGING SQL STATEMENTS > 4K
IX72350   TRIGGERS IN A SUBQUERY PREVENT OPTIMIZER FROM REWRITING SUBQUERY AS A JOIN.
JR11320   CONCURRENT LOADS TRAP
JR11344   CURSORHOLD=0 CAUSES SQL30081N AGAINST MVS DATABASE
JR11363   CURSORHOLD=0 CAUSES SQL30081N AGAINST MVS DATABASE
JR11349   ROUND FUNCTION RETURNS INCORRECT RESULTS WHEN ARGUMENT 2 IS NEGATIVE
JR11356   ODBC DRIVER RETURNING ERROR INSTEAD OF SUCCESS_WITH_INFO
JR11395   HIDE EXTENDED FETCH CAPABILITY
IX73014   SQLCANCEL IN JDBC DOES NOT WORK AS IT IS SERIALIZED.
IX73133   FIX PARTIAL SUPPORT FOR KOREAN CODEPAGE
JR11417   ROW DATA BEING SENT WITH SQL100 CONFUSES DRDA AR WHEN CONNECTING TO DB2 ON OS/2 AS THE DRDA AS
IX73143   SQL0289 - IF CUSTOMER DELETE X NUMBER OF RECORDS AND TRY TO INSERT BACK THE SAME NUMBER OF RECORDS.
JR11422   DB2STOP HANG AFTER A FORCE APPLICATION ALL WITH ACCESS FEATURE.
IX73136   A PASSWORD DEFINED WITHIN NIS+ WITHIN SOLARIS CANNOT BE AUTHENTI CATED BY DB2
JR11428   CLI0002W  DATA TRUNCATED. SQLSTATE=01004 {SQLDRIVERCONNECT} WHEN CONNECT STRING IS LONGER THAN 254 CHARACTERS
JR11433   LOG CORRUPTION WITH '504' MESSAGES IN DB2DIAG.LOG FILE
IX73248   WHEN DISABLEMULTITHREAD IS SET TO 0 IN THE DB2CLI.INI FILE THERE EXISTS A MEMORY LEAK IN THE SQO LAYER WHEN USING CLI
IX73355   ADDITIONAL DIAGNOSTIC INFORMATION FOR -902 IN SQLSFSCB
IX73311   -901 SQLNO_GREEDY_DISCONNECTED  250  DURING PREP
JR11481   DB2 NT TRAP IN DB2RDS.DLL WHEN A DESCRIBE INPUT IS BEING PROCESS ED FOR A STATEMNET THAT DOES NOT HAVE ANY PARAMETER MARKERS
JR11585   PROBLEM WITH LIST APPLICATIONS SHOW DETAIL - CHANGE STATUS TIME
JR11484   INTERMITTENT TRAP IN SQLUBINITPROCESS DURING BACKUP
JR11502   PATCH KEYWORD IN DB2CLI.INI TO OVERRIDE OTHER SETTINGS
JR11533   TRAP IN INDEX RECREATION PHASE OF LOAD WHEN INDEXES ARE DEFINED ON TABLE AND AFTER INTERMIM FIXPAK WR08140R IS APPLIED.
JR11348   LOAD OF SOME IXF'S TRAPS
JR11526   NLJN DOES NOT PRODUCE OPTIMUM ACCESS PLAN COMPAIRED TO V1
IX73959   ROLLFORWARD TABLESPACE GENERATES -1273 IF PRECEEDED WITH BACKUP/ RESTORE WITH NO WORK INBETWEEN
IX73998   MEMORY OVERWRITE DURING INDEX CREATION DUE TO VARIABLE NOT LARGE ENOUGH TO HOLD PACKED DESCRIPTOR VALUES
IX74229   REMOVING TRAILING PERIOD FROM DECIMAL TO CHAR.
JR11553   FLOATING POINT DATA TYPE RETURNS WRONG VALUE
IX71439   LOOPING FENCED UDF NOT CLEANED UP
IX73248   WHEN DISABLEMULTITHREAD IS SET TO 0 IN THE DB2CLI.INI FILE THERE EXISTS A MEMORY LEAK IN THE SQO LAYER WHEN USING CLI
JR11629   PATCH1=1 CAUSES COUNT(DISTINCT COL) TO FAIL.
JR11636   TRAP IN MEMTREEPUT DUE TO MEMORY CORRUPTION
IX74997   LOG FILES NOT ARCHIVE AFTER CRASH RECOVERY.
IX75097   TIMESTAMP PROBLEM IN 4WAY SMP SP2 AIX IN SQLOGMT2
JR11680   REMOVE 8K LIMIT ON SQL FOR EXPORT COMMAND
IX75443   OPTIMIZER ERRONEOUSLY FAVOURS LIST PREFETCH OVER TABLE SCAN WHEN SCANNING SMS TABLES WITH LESS THAN 32 PAGES.
IX75609   LIST APPLICATIONS CORRUPTS APP ID FOR LONG APP NAMES
IX75687   UNABLE TO RESTORE FROM A BACKUP TO ADSM USING MULTIPLE OPEN SESSIONS.
JR11722   INTERMITTENT DB2 TRAP IN FUNCTION SQLRIRETURNSUBSTRCSOBYTES OR SQLOFMBLK
JR11721   INTERMITTENT DB2 CRASH WHEN A CUSTOMER TRIED TO TAKE A SNAPSHOT
IX75937   SQL2542N FOR RESTORE OF A PREIOUS BACKUP THAT WAS DUMPED INTO 10 OR 20 OR 30/40/50/60/70/80/90 FILES IN THE SAME DIRECTORY
IX76834   MULTITHREADED CLI ON AIX 4.3, PROBLEM WHERE __N_PTHREADS CAN BE -1 EVEN THOUGH LINKED WITH PTHREADS
IX76172   STATEMENT OBJECT CREATED BY GETBINARYSTREAM IS NOT GETTING CLOSED
JR11769   AFTER 'FORCE APPLICATION ALL' COMMAND ON THE SERVER TCP/IP PORT (PORT 3700) IS NOT RELEASED FOR ABOUT 5-7 MINUTES.
IX76471   PERFORMANCE ENHANCEMENT TO INSERTS ON LARGE TABLES   
JR11817   AFTER INSERT OF DATA>32700 . THE NEXT INSERT<32700 WILL CAUSE A CRASH.
IX70529   DB2IUPDT->DB2ICRT CALLS DB2IMDBM WHICH NULLS TP_MON_NAME IN DB2SYSTM (DBM CFG) FILE
IX76443   PERFORMANCE PROBLEM OF A SELECT WITH AN ORDER BY
IX77137   RUNSTATS WITH DISTRIBUTION PICK INCORRECT PLAN
IX77066   BYTE REVERSAL ERROR BETWEEN NT & AIX.
JR11726   SPORADIC TRAPS IN SQLNQ_TABSEL_OFN_CM
JR11797   UDB CLIENT THROUGH DDCS WITH SPM TO THE HOST, THE XA_RECOVER CALL FAILS.
JR11824   TRAP IN DOSCALL1.DLL DURING CTRL-C
IX77399   CRASH RECOVERY ENDS TOO EARLY.
JR11853   SYS3175 IN SQLBTERM FUNCTION WHILE ATTEMPTING TO BRING A DATBASE DOWN THAT HAS BEEN MARKED BAD.  THIS BRINGS INSTANCE DOWN
IX77333   HP: SHARED MEMORY PROBLEM - BACKWARD FIT UDB FIX FOR V2
IX71898   INCORRECT OUTPUT FOR FUNCTION LOG10
JR11810   UDB NT TAPE RESTORE RETURNS SQL2530 -- IMAGE CORRUPT.
IX76678   SQL1042 ON GET SNAPSHOT FOR APPLICATIONS ON SOLARIS 2.5.1 WITH SUN PATCH 104283 OR SOLARIS 2.6
IX78244   REORG OF COMPACT BLOB EXPANDS OBJECT TO NON-COMPACT SIZE
IX78307   CONNECT TO REMOTE DB FAILS WITHOUT AN ERROR.RETURNS TO A PROMPT.
IX79090   CHECK IN PROPER VERSION OF SIGNAL HANDLER IN JDBCSERVER.C
IX78836   ALTER TABLE ... NOT NULL DEFAULT CURRENT TIMESTAMP FAILS -193
JR12009   OS2 SMP:SQLOFMBLK RETURNS SQLO_INV_MEM TO SQLBINIT (PROBE:80)
IX79090   CHECK IN PROPER VERSION OF SIGNAL HANDLER IN JDBCSERVER.C
IX79235   INTERMITTENT SIGNAL 11 IN SQLULUMW
 23695       148414      100822      901226749   2379        200         644         11  lpp.fixinfo `
********************************************************************
 Product Name : DB2 Database Server for AIX 
 Package Name : U458629 
 Packaged By  : Paul Lee
 Package Date : Fri Jul 17 10:30:54 EDT 1998
 Build Level  : c980627 
********************************************************************
APAR No.  Abstract
--------  ----------------------------------------------------------
IX60403   CALL TCP/IP _R FUNCTIONS
IX64284   FP UNDERFLOW (TOO MANY PREDS) CAUSES BAD PLAN
JR09106   INCORRECT UPDATE OF DB2/6000 LOGFILSIZ FROM DB2DD/2
JR09200   SQL0444N (-444) FROM AS/400 EXECUTING STORED PROCEDURE
JR09350   RESTORE GOT DBABG.EXT ACCESS VIALATION 0X00000005
IX60015   SQLURLOG_API (ASYNS LOG READ API) RETURNS WITH AN SQL2657N INCORRECTLY WHEN IT SHOULD NOT.
IX60737   DUMP OSS RC CALLED FROM LOAD UTILITY WHEN REMOTE FILE IS OPENED.
IX60794   DB2/6000 V2.1 BACKUP WILL LEAVE 2 IPCS AFTER COMPLETING.  ONE IS A SEMAPHORE, AND THE OTHER IS A MESSAGE QUEUE.
JR09268   CREATING AN EVENT MONITOR IN DB2/NT V2.1.1 FROM THE CLP DOES NOT ACCEPT THE WINDOWS/NT SYNTAX FOR A LOCAL NAMED PIPE.
IX61036   PREP COBOL APP. WHICH HAS $SET GENRATES SQL4001
IX61101   BACKUP TO ADSM SHOULD UPDATE FILESPACE, IF IT ALREADY EXISTS
IX61129   MEMORY LEAK IN LONG RUNNING CLP DOING REPEATED UDF REFERENCES IN DB2/6000 V2.
JR09307   DB2/2 V2.1 REXX API 'GET RECOVERY HISTORY FILE ENTRY' FAILS WITH SQL2165W ERROR IF BACKUP ENTRY CONTAINS MORE THAN 4 TABLESPACES.
JR09291   DB2 ODBC DRIVER CAUSES SQLTABLE TO USE TABLE SCAN ON DB2/MVS THUS  RESULT IN PERFORMANCE PROBLEM
JR09292   UPDATE BASED ON DATE FIELD FAILS FROM ODBC APPLICATIONS
JR09293   HANG DURING EXPORT
IX61923   EXPORTING LOB FILES EXCEEDS 1000.
JR09314   THE PROBLEM IS DUE TO THE CONNECTION ACCESS MODE BEING CHANGED TO READ_ONLY.
JR09226   GRAPHIC DATA TYPE PROBLEMS WITH ODBC FROM MS ACCESS
JR09319   CLOB FIELD RETURN INCORRECT LENGTH ON 0 LENGTH STRING WHEN SQLBIND IS + 1 OF THE ACTUAL LENGTH OF THE CLOB
JR09339   LOGIC ERROR IN SQLE_DB2RA_AS_HOPDRIVER_FREE
IX62442   CLEAN UP ERROR PROCESSING FOR NON-ATOMIC ARRAY PROCESSING WHEN PROCESSING IN CLI
IX62275   DB2STOP HANGS INTERMITTENTLY ON AIX 3.2.5 OR 4.1.4
IX62287   DB2/6000 V2.1.1 - QUERY USING CORRELATED SUBQUERY ON ONE TABLE WITH INDICES IS RETURNING WRONG NUMBER OF ROWS IN RESULT SET.
JR09376   16 BIT APPLICATIONS CAUSE PAGE FAULT WHEN DOING SQLCONNECT A INVALID DSN LENGTH IS SENT TO US.
JR09380   OFFLINE BACKUP SHOULD NOT COMPLETE WITH MISSING TABLE DAT FILES.
IX62442   CLEAN UP ERROR PROCESSING FOR NON-ATOMIC ARRAY PROCESSING WHEN PROCESSING IN CLI
JR09399   HISTORY FILE IS NOT UPDATED AFTER DATABASE BACKUP TO TAPE USING SAMPLE USEREXIT.
IX62424   APPENDING TO BLOB COLUMNS FAILS WITH SQL0902 RC=110
IX62454   PAGE CLEANERS FLOOD THE DB2DIAG FILE AND DB2 HAS TO BE STOPPED.
IX62464   BINDING TO A BLOB COLUMN CAUSES SEGMENTATION FAULT.
IX62502   DB2STOP HANGS WHEN DATABASE PREVIOUSLY ACTIVATED
JR09419   COUNTRY CODE FOR SLOVENIA IS NOT SUPPORTED IN DB2/NT
IX62910   DB2 LOST CONNECTION FROM CICS APPLICATION SERVER CAUSES CICS REGION TO CRASH.
JR09425   SQL/DS RETURNS -515 ON COMMIT
JR09426   CONVERTING FROM ASCII TO FLOAT ON DB2/NT IS DEPENDANT ON THE LOCALE.  IMPORTING A ASCII FILE TO A FLOAT COLUMN FAILS (SPAIN)
IX62813   RESTORE FROM TAPE TRAPS
JR09435   SQL30073 RC 0010 FROM AR IF APP USES FIXCHAR WITH LENGTH >254
JR09436   DDCS/2 GATEWAY SYS3175 NETAPI.DLL WITH SECURITY SAME
JR09443   DB2 CLI ODBC DRIVERS TRUNCATE DIGITS AFTER DECIMAL POINT ON CLIENTS WHICH USES COMMA AS THE DECIMAL POINT
JR09467   CLI0102E INVALID CONVERSION ERROR ON SQLFETCH FOR AN SQLTABLES CALL WHEN GOING TO THE AS400.
JR09442   SQL_SUCCESS_WITH_INFO FROM SQLFETCH USING MS ACCESS. TABLE ON THE DB2/MVS SYSTEM WHICH HAS MORE THEN 22 FIELDS.  DUPLICATE ROW
IX62759   PROBLEM WITH DB2LOOK TOOL IN DB2/6000 V2.1.1.  MIMIC OPTION IS NOT HANDLING UNIQUE INDEXES AND PRIMARY KEYS PROPERLY.
JR09454   IMPROVE MIGRATE DIAGNOSTICS.
IX62897   8 TABLE JOIN TOO BUSHY AT OPTIMIZATION LEVEL 0 WHEN STATISTICS HAVE BEEN UPDATED.
IX57283   LONG FIELD DATA CORRUPTED WHEN MULTIPLE PROCESSES INSERTING LONG FIELD DATA INTO THE SAME TABLE
JR09477   EXPORT OF WSF FOR V1.2 AND V2.1 DIFFER IN THE CONTENTS OF THE FILE WHEN THE SUM FUNCTION IS PART OF THE SELECT STMT
JR09467   CLI0102E INVALID CONVERSION ERROR ON SQLFETCH FOR AN SQLTABLES CALL WHEN GOING TO THE AS400.
IX58313   DB2/6000 V211 ACTIVATE, BACKUP, RESTORE, CONNECT GIVES SQL1042
JR09319   CLOB FIELD RETURN INCORRECT LENGTH ON 0 LENGTH STRING WHEN SQLBIND IS + 1 OF THE ACTUAL LENGTH OF THE CLOB
JR09518   ON A SQLDRIVERCONNECT THE SECOND CONNECT WITH A SMALLER PASSWORD RETURNS AN INCORRECT PASSWORD. (APPENDS FIRST PASSWORD TO END)
IX64297   TEST
JR09616   PRECOMPILE OF COBOL SOURCE CODE WITH THOUSANDS OF HOST VARIABLES MAY CAUSE SQL0083C ERROR.  NEED TO INCREASE THE MEMORY POOL.
JR09686   CONNECTION FROM WINDOW SUPPORT FAILS LOOKING FOR DB2CPICW.DLL
JR09694   TRAP IN DB2SQL1 IN SQLNQ_GET_BASE_FCS() FROM A SELECT FOR UPDATE ON A VIEW.
JR09852   SELECT DECIMAL (-1,1,0) FAILS IN CLI
IX62276   GETTING LIBDB2VES.A IS UNDEFINED WITH VISUAL EXPLAIN
JR09424   PRECOMPILE OF A COBOL APP WITH SDK/NT LEAVES OUT A . AT THE END OF THE CALL-CONVENTION LINE IF SPECIAL-NAMES IS DEFINED ALREADY.
JR09457   PREP ADDING "SPECIAL-NAMES" IN INCORRECT SECTION OF COBOL APP
IX62803   SIGNAL #11 IN SQLRCFDA DURING FREEING OF ACCESS ALLOCATIONS
IX63070   SDK FOR HP-UX V2 AND SUN V2 WILL NOT WORK BECAUSE NO DB2RTE.
JR09592   SQL_C_BINARY PASSED TO A STORED PROCEDURE GETS PROMOTED TO A SQL TYPES THAT MATCHES THE SIZE IGNORING THE TYPE IN BINDPARAMATER.
JR09698   BACKUP WITH USEREXIT GENERATES SQL2003, SQLCA -2024 ... 7B IN DOSOPEN - DEBUG DB2EUTIL.DLL MASKS PROBLEM
JR09862   SQLGETDATA() RC=S1004 & PCBVALUE WRONG IF CALLED WITH SAME COL#
IX65400   LOAD OF A LARGE DATASET WILL FAIL IN THE BUILD OR DELETE PHASE
IX65124   STORED PROCEDURE CORRUPTS A LARGE RETURN SQLDA
JR09886   -902 REPORTED BY SQLRARVP DURING RUNSTATS
IX65131   DEPENDENCIES INTRODUCED BY CORRELATION IN HXPS NOT WORKING OK   
IX65158   ONLINE BACKUP REMOVES THE LOCKS MADE BY QUIESCING AND THEN PUTS THEM BACK.
IX65185   DB2/6000 V2.1 TRAPS AFTER PREFETCHERS AND/OR PAGE CLEANERS CAN NOT BE ALLOCATED PROPERLY DURING FIRST DATABASE CONNECTION.
IX65188   UNABLE TO FORCE APPLICATIONS WHICH SHOW UP IN LIST APPLICATIONS
IX65191   CORE FILE GENERATED IN SQLORESOLVEADDRESS WHEN UDF RTRIM INVOKED
JR09901   ROLL FORWARD THROUGH THE LOGS GENERATES A TRAP IN DB2DMGR.DLL IN THE SQLICKEY FUNCTION
JR09914   CUMULATIVE COST AFTER NLJOIN IS TOO SMALL
JR09902   ODBC LOGON SCREEN DOES NOT GET PLACED AS THE FRONT WINDOW
JR09903   BIND SQL_C_TYPE '0' TO SQL_DECIMAL WITH SQLBINDPARAMETER() FAILS
JR09912   SQL3022 ON EXPORT FROM V1.2 CLIENTS THROUGH DDCS V2.3.2
JR09920   RECEIVE A CLI0112E STATE 22005 WHEN INSERTING FROM POWER BUILDER AND CAE/WIN-OS/2 2.1.1 811+
JR09917   CLIENT HANGS WHEN DOING A QUERY THREW DDCS TO MVS
JR09922   ADD #INCLUDE <STRING.H> TO SAMPLES\CLI\SAMPUTIL.C
JR09936   INCLUDE DEFECTS 56919,56923,57281,58767 INTO 2.1.2
JR09939   FILTER FACTOR FOR 'LIKE %' IS INCORRECT
JR09950   REXX API FOR CATALOG DATABASE USES AUTHENTICATION SERVER 
IX65422   JAVA LINKS NOT BEING CREATED DURING INSTANCE UPDATE AFTER UPGRADING TO DB2/6000 V2.1.2 FROM V2.1.1.
JR09951   PROBLEMS WITH CHINESE CODEPAGE TRANSLATION WHEN CODE PAGE IS SET TO 1381 ON OS/2 AND 1383 ON AIX
IX65659   BACKUP ON DB2/HP V2.1.2 FAILS.
IX65568   SQL0444 RETURNED ON USE OF RTRIM FUNCTION.  DB2CLIFN.A NOT FOUND
IX65614   INVALID MEMORY BLOCK DURING PREP IN THE DIAG FILE (SQL0083).
JR09984   DB2DD APPC CATALOG IN ERROR
IX65739   LIBDJRA.A IS NOT SHIPPED AND CONNECTS TO DOWNLEVEL SERVERS WILL FAIL WITH A SQL10013.
JR10064   SQLSTATISTICS CALL TO A MVS HOST THAT HAS A INDEX COLUMN NAME WITH DBCS IN IT CAUSE A SUBSTITUTION ERROR (01517)
JR10102   ADD FOR FETCH ONLY TO THE STATIC SCHEMA CALLS FOR DB2/400 AND DB2 MVS.
JR10105   DB2 VALUES CHAR('STRING',LENGTH('STRING')) GENERATES SQL0901 SHOULD GENERATE SQL0123
IX66149   SOUNDEX UDF IS RETURNING INCORRECT RESULTS IN DB2/6000 V2.1. DB2/2 V2.1 RETURNS THE PROPER VALUES.
IX66200   MEMORY THRESHOLD USED FOR THE AGENTPOOL
JR10137   POWER BUILDER ( POWERSOFT ) APPLICATION CAUSES A GPF IN DB2W.DLL
JR10147   TRAP IN DB2SYSC
IX67183   SQLPROCEDURECOLUMNS RETURNS A PRECISION OF 0 IF A PARAMETER IS DEFINED AS PARMNAME CLOB(1000)
JR10150   PROBLEM WITH MULTITHREADING IN THE CAE FOR SOLARIS
IC16687   CLIENT DOES NOT HANDLE OUTER JOIN
JR10169   SQLO_REMOVE_STATIC_DATA_ANCHORS IS NEVER CALLED ON NT
JR10304   SUPPORT FOR CODE PAGE 819 LATIN 1 IN CAE FOR OS/2
JR10183   -305 TO AN APPLICATION MAKING A REMOTE PROCEDURE CALL TO HOST SYSTEM DUE TO MISHANDLING OF INDICATOR VALUE. DDCS
JR10203   QUALIFIER SUPPLIED TO SQLTABLES CALL ARE IGNORED
IX66817   LOAD LARGE TABLE WITH INDEX TRAPED IN SQLU_SBGETPG (SIG. 11)
JR10212   PERFORMANCE PROBLEM WITH SQLCOLUMNS CALL AGAINST DB2/400
IX66913   PERIODIC SQL0902 RC 24 (INCORRECT TABLE HANDLE ENCOUNTERED) DUE TO WANDERING MEMORY OVERWRITE
JR10370   DBCS SUPPORT FOR JDBC ON JDK V1.02 ON OS/2
JR10208   TRIGGER RETURNS SQL100 FOR UPDATE INSTEAD OF SQL445.
IX67033   DB2ADUTL DELETE KEEP... INCORRECTLY DELETES LOGS
IX67077   SQL1227 WHEN UPDATING HIGH2KEY IN SYSSTAT.COLUMNS (SAP)
IX67093   FORKING AND CLI CALLS ON AIX CAN RESULT IN PROBLEMS FOR THE CHILD PROCESS.
JR10221   BUG IN THE ERROR LOGGING PATH
JR10234   AUSTRIAN CODE PAGE SUPPORT REQUIRED IN DB2 V2
JR10303   SQL0902C WITH RC = 70 ON THE CLIENT WHEN A LARGE AMOUNT OF DATA IS BEING RECEIVED FROM THE SERVER
IX67258   DB2 THINKS APPLICATION IS MULTI THREADED
IX67291   DB2 2.1.2 COMMAND LINE REDIRECTED RESTORED WITHOUT PROMPTING TRAPS IMMEDIATELY WITH A SQL1224
IX67296   -1042C LANG=JA_JP-ACTIVATE DB FOLLOWED BY DB2STOP LEAVES DANGLING PROCESSES AND LEADS TO NEXT CONNECTION TO DB FAILS.
IX67302   TRAPPING DOING ADSM BACKUP IN WALK_LIB.   
IX67307   ODBC/CLI PERFORMANCE IMPROVEMENTS IN V2.1.2
JR10299   SQLTABLES CALL ON A SYSTEM TABLE THAT HAS A SYSSCHEMA THE SAME AS THE TABLE CREATOR THE TABLE TYPE WILL BE SYSTEM TABLE
IX67436   DB2/6000 V2.12 HANGS
IX67458   CURRENT TIMESTAMP RETURNED BY DB2/6000 V2.1 INCORRECT WHEN THE MICROSECOND PORTION SUPPOSED TO BE ALL ZEROS.  ONLY ON 604-SMP.
JR10312   RESTORE OF DB2 V2.1.2 DATABASE FAILS WITH AN SQL0902C, RC=72 ERROR.
IX67484   TRAP ON EXIT OF A FORKED CHILD DUE TO THE INTERRUPT HANDLER TRYINT TO CLEANUP INVALID CTX'S FROM INHERITED FROM PARENT
JR10328   RUNNING MORE THAN ONE USEREXIT AT THE SAME TIME WILL CAUSE ONE TO HANG.
JR10347   SQLCANEL FAILS WITH -1 WHEN EXECUTED.  SQLERROR CALL RETURNS NO ERROR.
IX67732   FIX VARIOUS PROBLEM FOUND BY A CUSTOMER
JR10387   SQL0902N RC 81 RUNNING DDCS/2 APP AGAINT DB2/VM AND DB2/VSE 5.1.0
IX67750   CLP TOKEN SIZE SHOULD BE >1024
IX67774   DDCSTRC ON -L 8000000 ... INCORRECT SYNTAX (MISSING = SIGN) WILL CAUSE A CORE DUMP ON LANG=JA_JP
JR10406   A NUMBER OF JDBC FIXES
IX67838   POOR LOGGING LOGIC WITH LOGRETAIN + USEREXIT
IX67875   DB2DD FAILS MOUNTING CONTAINERS TO A NEW VOLUME GROUP
IX67928   MEMORY LEAK WHEN USING CLI
JR10446   MS-QUERY RETURNS SQL0104N ERROR WHEN TRYING TO SELECT AGAINST DB2/MVS 3.1
JR10405   A QUERY AGAINST A VIEW IN DB2 COMMON SERVER V2.1.2 FAILS WITH AN SQL0901N ERROR, REASON = 'OID IMBALANCE'.
JR10462   DDCS/NT GATEWAY TRAP WITH DB2SYSC.EXE WHEN VOLUME IS HIGH
JR10473   SQL2044 RC 4 ON FAILING LOAD.  INVALID MESSAGE RECEIVED FROM A MESSAGE QUEUE.
IX68173   SQLCOLUMNS CALL RETURN INCORRECT RESULTS FOR USER DEFINED TYPES.
JR10474   SETTING SQLSTATE FIELD OVERWRITES SOMEOTHER FIELD IN MEMORY.
JR10480   WHEN INSERTING A SET OF ROWS USING ODBC AND SQLPREPARE AND SQLEXECUTE A TRAP IN DB2SYSCS.EXE
IX68236   TIMESTAMP GROWS WITH HIGH # OF CONNECTIONS
JR10504   SQLTABLES CALL WITH A (NOT NULL/ZERO LENGTH STRING) CATALOGNAME CAUSES AND ERROR.
JR10517   SQLPUTDATA RETURN -1 WITH VALID POINTER OF 0 LENGTH INPUT
IX68370   CLI0131E ERROR WHEN TRYING TO 'EDIT QUERY'  TO DB2/6000.
JR10519   DB2 MEMORY LEAK WITH FENCED UDF CALLS
IX68406   DB2 INSTALL FAILS ON SINIX 5.43 AND HIGHER
JR10586   TRAP IN DB2PGIXT, DURING LOGGING RELATED: WIN95 NOT RECOGNIZING 'CMD.EXE' EXECUTABLE
IX68441   INSERTING INTO DB2 V2.1.2 TABLE GIVES SQL0901N, REASON = 'COLUMN NUMBER OUT OF RANGE'.  DUPLICATE COLUMNS EXIST IN COLUMN LIST.
JR10612   RETURN ONLY UNIQUE ROWS FROM SYSIBM.SYSPROCEDURES WHEN CONNECTED TO DB2 FOR MVS.
JR10608   IMPORT FROM SDK/WIN31 V210 FAILS WITH SQL3011C: NOT ENOUGH STORAGE TO PROCESS THE COMMAND.
JR10602   TRAP IN SQLNG_PROCESS_PARSE_TREE() DURING A PREP DB2 V2
JR10615   TRANSACTION LOGGING CODE IGNORES SERIOUS ERROR
JR10607   TRAP IN DB2ASP0.DLL (NOTE, TRAP SCREEN SHOWS DB2SYSC)
IX68677   DB2/6000 V2.1.2 DATABASE ROLLFORWARD FAILS WITH SQL1224N ERROR. TRAP FILE SHOWS A SIGNAL #11 IN SQLDX_WRITE_PARTIAL_PAGE().
IX68682   LIST TABLESPACES FREE PAGES NOT UPDATED FOR DMS TABLES AFTER DROP TABLE.
JR10460   VARCHAR/LONG VARCHAR ARE NOT SUPPORTED IN FORTRAN - NEED TO ADD THIS SUPPORT
IX73231   QUERY WAS GETTING VERY BAD PERFORMACE IN A QUERY WHEN RUNSTATS FOR A TABLE WAS RUN WITH DISTRIBUTION.
IX61374   CICS/6000 TERMINATES AFTER BAD XACLOSE USING DDCS/6000
IX62913   DISK FULL MESSAGE WHEN OPENNING LOG FILE NEED CORRECT OS RC.
JR09881   INCONSISTENT RESULTS FROM THE DB2DART TOOL
JR10020   'CONNECT TO :NULLSTRING' BEHAVIOUR HAS CHANGED BETWEEN DB2 V1.X AND DB2 V2.1.  THE BEHAVIOUR IN V1.X IS CORRECT.
JR10121   SQL0001 DURING ACTIVATE DB AFTER A CONNECTION TO THE DB WAS ESTABLISHED FROM A DIFFERENT SESSION.
JR10162   ACCESS PLAN FOR CERTAIN QUERIES DOES NOT USE A TEMP TABLE (AS WAS DONE IN V1) WHICH PRODUCES BAD PERFORMANCE VS V1.
JR10218   MIGRATE DBASE FROM V1 TO V2 FAILS IF MAXAPPL OR MAXLOCK < 100
JR10370   DBCS SUPPORT FOR JDBC ON JDK V1.02 ON OS/2
JR10324   BACKUP OPERATION NOT RELEASING ALL MEMORY ONCE COMPLETED CAUSING RANDOM TRAPS IN DB2 AFTER A BACKUP
JR10327   V2 ONLY: RETROFIT OPTIMIZE FOR N ROWS FIXES TO V2
JR10336   SYS3175 TRAP IN DB2APP.DLL DURING AN EMBEDDED SQL CONNECTION ATTEMPT IN DB2/2 V2.1.2.  SQLASTRT IS THE FUNCTION ABENDING.
JR10404   CHANGE OF DATABASE AT THE USERID AND PASSWORD PROMPT OF THE DB2 DRIVER DOES NOT TAKE EFFECT.
JR10479   TRAP IN DB2 WHEN NON DB2 DATA IS WRITEN TO OUR TCPIP PORTS. THE TCP/IP INTERUPT PORT IS THE FAILING ONE
IX68437   PASS ENVIRONMENT VARIABLES THROUGH TO STORED PROCEDURE.
IX68697   SQL0298 ON COMMAND LINE REDIRECTED RESTORE DB2/AIX 2.1.2
JR10751   SYS3175 TRAP DURING A DATABASE CONNECTION (RESTART).  PRIOR TO THIS, A REORG TRAPPED LEAVING THE DATABASE INCONSISTANT.
JR10755   LOAD OF AN IXF FILE WILL CAUSE TRAP ON ANY OPERATING SYSTEM. AIX GIVES SIGNAL #4, OS/2 C0000005 IN SQLULIRA
IX69111   LOAD FAILS IN BUILD PHASE
JR10785   DB2STOP TRAPS IN DB2SYS.DLL ON WARP SMP WITH LOGRETAIN ON
IX70344   UABLE TO LINK A HP APP TO DB2
IX69332   WHEN INX PAGES GET CORRUPTED , DB2AGENT GOES INTO AN INFINITE LOOP.
JR10795   DB2 2.1.2 MAY INCORRECTLY UNDER-COST A PLAN AND CONSEQUENTLY CHOOSES A BAD PLAN
JR10834   SUPPORT FOR JDK V1.1
IX69549   DB2DD GOES INTO AN INFINITE LOOP BUILDING THE COLOR MAP
JR10835   SQL0305 (SQLSTATE 22002) RETURNED WHEN USING COGNOS DUE TO NULL INDICATOR VARIABLES NOT BEING SPECIFIED.
JR10837   BACKUP TO 0 GENERATES BLANK LINES IN .RST FILE THIS CAUSES TRP IN RESTORE FROM 0 (USEREXIT HAS ZIP COMMAND)
IX69610   JAPANESE CODE PAGES RESULT IN A CONVERSION ERROR MESSAGE IN THE DB2DIAG.LOG
JR10844   SQLNATIVESQL RETURNS MISPLACED RIGHT PARENTHESIS FOR CALL STMT
JR10848   TRAP IN DB2DARI.EXE WHEN SQLDBCON GETS NULLED OUT (IN SQLERIAR_CONNECT)
IX69111   LOAD FAILS IN BUILD PHASE
JR10876   LOGRETAIN NOT USING ALL AVAILABLE LOG SPACE
IX69806   HALF DATA RECD FOR DOUBLE BYTE COLS UNDER VB RDO.
IX67033   DB2ADUTL DELETE KEEP... INCORRECTLY DELETES LOGS
JR10834   SUPPORT FOR JDK V1.1
IX70033   SQLSETENVATTR WITH SQL_ATTR_OUTPUT_NTS NOT WORKING PROPERLY WHEN IT SET TO SQL_FALSE
IX70040   DBI1105W WHEN DOING A DB2IUPDT
JR10908   INVALID PARAMETER PASSED TO USER EXIT.
IX70279   UNABLE TO BREAK 64 GB BARRIER WHEN LOADING/IMPORTING LOB FIELDS.
JR10930   SQLP_ASYNCLOGREADAPI FAILURE USING DATAPROPAGATOR CAPTURE DUE TO LOG NOT BEING AVAILABLE.
IX70179   TAPE RESTORE FROM DB2/NT AFTER V2.1.2 GA FAILS. SQL2058W  AN END-OF-MEDIA.
IX70183   DB2 WILL HANG ON BACKUP IF 'WITHOUT PROMPTING' IS SPECIFIED AND THE BACKUP REACHS THE END OF THE TAPE.
JR10935   RESTORE USING USEREXIT IS CHANGING LOG PATH BACK TO DEFAULT
JR10940   'HIGH WATER MARK FOR DATABASE HEAP' IS NOT TRACKED CORRECTLY.
JR10963   RUNSTATS UPDATES CERTAIN VALUES INCORRECTLY.
JR10965   SQLSETCOLATTRIBUTES() PROBLEM WHEN STATEMENT HANDLE REUSED
IX67258   DB2 THINKS APPLICATION IS MULTI THREADED
JR10969   CONNECTIONS CREATED VIA HOPPING DO NOT GET CLEANED UP WHEN A REMOTE CLIENT REBOOTS
JR10973   GETASCIISTREAM TRAPS SERVER WHEN RETURNING ZERO LENGTH STRING
JR10975   LOAD TABLE FROM AN IXF ENCOUNTERED -3314N
JR10978   DB2DART DOES NOT CHECK FOR RECORD LENGTH=0
JR11011   JDBC PERFORMANCE ISSUES
JR11013   RESTORE VIA USEREXIT WITH DIFFERENT INSTANCE NAME FAILS
JR11025   SQLPRIMARYKEY/SQLFOREIGNKEY LOCKUP SYSTABLES IN AUTOCOMMIT MODE
JR11026   CLI0112E WHEN USING COMMA DELIMITED NUMBERS THROUGH ODBC DRIVER.
IX70903   CRASH RECOVERY COMPLETES BUT CODEPAGE MIXMATCH MARKS DB BAD.
JR11040   INVALID QUERY USING GROUP BY CLAUSE TRAPS ENGINE
JR11049   OBSOLETE DBMON TCB'S LEFT AFTER DATABASE PAUSE
IX71104   DB2BATCH CORE DUMPS WHEN USING -CLI AND -O WITH P > 1 EX: DB2BATCH -D SAMPLE -F <FILENAME> -O P 3 -CLI
JR11073   SQL0332N - CODEPAGE CONVERSION BETWEEN 500 AND 1275
IX71266   SQL10013 - ON SIXTH INVOCATION OF STORED PROCEDURE
JR11071   APPC LISTENER MUST BE RESTARTED WITH DB2STOP
JR11111   SYNC POINT MANAGER AUTHENTICATE USER INCORRECTLY
IX72355   A TRAP WITHIN A STORED PROCDURE IN SQLE_MRSP. DB2SYSC CORE DUMP
IX71625   CREATE DATABASE FAILS ON E30/AIX415 ON A LOB CHECK
IX71612   SQL0204 FOR IMPORT WITH REPLACE OPTION INTO A TABLE OWNED BY THE USER BUT IS NOT FULLY QUALIFIED IN THE IMPORT COMMAND
IX71837   USING FOR BIT DATA AND NORMAL CHAR TYPES IN A MERGE JOIN LEADS TO INCORRECT OUTPUT.
JR11337   SQL3401 SQLGIMP COBOL API DOES NOT IGNORE FILLER BYTES
IX71992   PROBLEMS DOING A PERFORMANCE MOVE OF LOG FILE WILL CREATE NEW
IX71996   LOAD INTO A TABLE ALIAS FAILS WHEN RETRIEVING COLUMN DEFAULTS
JR11208   TRAP AFTER MANY SEQUENTIAL BACKUPS
IX72125   DB2ADUTL TRIES TO EXTRACT BACKUP ARCHIVE WHEN IT'S ASKED FOR LOG ARCHIVES.
JR11261   DB2 COMMON SERVER - 'INTERSECT ALL' RETURNS TOO MANY ROWS.
JR11296   MEMORY LEAK IN JDBC APPLICATION DRIVER WITH SETSTRING/GETSTRING
JR11312   MEMORY OVERWRITTEN WHEN LOGGING SQL STATEMENTS > 4K
IX72350   TRIGGERS IN A SUBQUERY PREVENT OPTIMIZER FROM REWRITING SUBQUERY AS A JOIN.
JR11320   CONCURRENT LOADS TRAP
JR11344   CURSORHOLD=0 CAUSES SQL30081N AGAINST MVS DATABASE
JR11363   CURSORHOLD=0 CAUSES SQL30081N AGAINST MVS DATABASE
JR11349   ROUND FUNCTION RETURNS INCORRECT RESULTS WHEN ARGUMENT 2 IS NEGATIVE
JR11356   ODBC DRIVER RETURNING ERROR INSTEAD OF SUCCESS_WITH_INFO
JR11395   HIDE EXTENDED FETCH CAPABILITY
IX73014   SQLCANCEL IN JDBC DOES NOT WORK AS IT IS SERIALIZED.
IX73133   FIX PARTIAL SUPPORT FOR KOREAN CODEPAGE
JR11417   ROW DATA BEING SENT WITH SQL100 CONFUSES DRDA AR WHEN CONNECTING TO DB2 ON OS/2 AS THE DRDA AS
IX73143   SQL0289 - IF CUSTOMER DELETE X NUMBER OF RECORDS AND TRY TO INSERT BACK THE SAME NUMBER OF RECORDS.
JR11422   DB2STOP HANG AFTER A FORCE APPLICATION ALL WITH ACCESS FEATURE.
IX73136   A PASSWORD DEFINED WITHIN NIS+ WITHIN SOLARIS CANNOT BE AUTHENTI CATED BY DB2
JR11428   CLI0002W  DATA TRUNCATED. SQLSTATE=01004 {SQLDRIVERCONNECT} WHEN CONNECT STRING IS LONGER THAN 254 CHARACTERS
JR11433   LOG CORRUPTION WITH '504' MESSAGES IN DB2DIAG.LOG FILE
IX73248   WHEN DISABLEMULTITHREAD IS SET TO 0 IN THE DB2CLI.INI FILE THERE EXISTS A MEMORY LEAK IN THE SQO LAYER WHEN USING CLI
IX73355   ADDITIONAL DIAGNOSTIC INFORMATION FOR -902 IN SQLSFSCB
IX73311   -901 SQLNO_GREEDY_DISCONNECTED  250  DURING PREP
JR11481   DB2 NT TRAP IN DB2RDS.DLL WHEN A DESCRIBE INPUT IS BEING PROCESS ED FOR A STATEMNET THAT DOES NOT HAVE ANY PARAMETER MARKERS
JR11585   PROBLEM WITH LIST APPLICATIONS SHOW DETAIL - CHANGE STATUS TIME
JR11484   INTERMITTENT TRAP IN SQLUBINITPROCESS DURING BACKUP
JR11502   PATCH KEYWORD IN DB2CLI.INI TO OVERRIDE OTHER SETTINGS
JR11533   TRAP IN INDEX RECREATION PHASE OF LOAD WHEN INDEXES ARE DEFINED ON TABLE AND AFTER INTERMIM FIXPAK WR08140R IS APPLIED.
JR11348   LOAD OF SOME IXF'S TRAPS
JR11526   NLJN DOES NOT PRODUCE OPTIMUM ACCESS PLAN COMPAIRED TO V1
IX73959   ROLLFORWARD TABLESPACE GENERATES -1273 IF PRECEEDED WITH BACKUP/ RESTORE WITH NO WORK INBETWEEN
IX73998   MEMORY OVERWRITE DURING INDEX CREATION DUE TO VARIABLE NOT LARGE ENOUGH TO HOLD PACKED DESCRIPTOR VALUES
IX74229   REMOVING TRAILING PERIOD FROM DECIMAL TO CHAR.
JR11553   FLOATING POINT DATA TYPE RETURNS WRONG VALUE
IX71439   LOOPING FENCED UDF NOT CLEANED UP
IX73248   WHEN DISABLEMULTITHREAD IS SET TO 0 IN THE DB2CLI.INI FILE THERE EXISTS A MEMORY LEAK IN THE SQO LAYER WHEN USING CLI
JR11629   PATCH1=1 CAUSES COUNT(DISTINCT COL) TO FAIL.
JR11636   TRAP IN MEMTREEPUT DUE TO MEMORY CORRUPTION
IX74997   LOG FILES NOT ARCHIVE AFTER CRASH RECOVERY.
IX75097   TIMESTAMP PROBLEM IN 4WAY SMP SP2 AIX IN SQLOGMT2
JR11680   REMOVE 8K LIMIT ON SQL FOR EXPORT COMMAND
IX75443   OPTIMIZER ERRONEOUSLY FAVOURS LIST PREFETCH OVER TABLE SCAN WHEN SCANNING SMS TABLES WITH LESS THAN 32 PAGES.
IX75609   LIST APPLICATIONS CORRUPTS APP ID FOR LONG APP NAMES
IX75687   UNABLE TO RESTORE FROM A BACKUP TO ADSM USING MULTIPLE OPEN SESSIONS.
JR11722   INTERMITTENT DB2 TRAP IN FUNCTION SQLRIRETURNSUBSTRCSOBYTES OR SQLOFMBLK
JR11721   INTERMITTENT DB2 CRASH WHEN A CUSTOMER TRIED TO TAKE A SNAPSHOT
IX75937   SQL2542N FOR RESTORE OF A PREIOUS BACKUP THAT WAS DUMPED INTO 10 OR 20 OR 30/40/50/60/70/80/90 FILES IN THE SAME DIRECTORY
IX76834   MULTITHREADED CLI ON AIX 4.3, PROBLEM WHERE __N_PTHREADS CAN BE -1 EVEN THOUGH LINKED WITH PTHREADS
IX76172   STATEMENT OBJECT CREATED BY GETBINARYSTREAM IS NOT GETTING CLOSED
JR11769   AFTER 'FORCE APPLICATION ALL' COMMAND ON THE SERVER TCP/IP PORT (PORT 3700) IS NOT RELEASED FOR ABOUT 5-7 MINUTES.
IX76471   PERFORMANCE ENHANCEMENT TO INSERTS ON LARGE TABLES   
JR11817   AFTER INSERT OF DATA>32700 . THE NEXT INSERT<32700 WILL CAUSE A CRASH.
IX70529   DB2IUPDT->DB2ICRT CALLS DB2IMDBM WHICH NULLS TP_MON_NAME IN DB2SYSTM (DBM CFG) FILE
IX76443   PERFORMANCE PROBLEM OF A SELECT WITH AN ORDER BY
IX77137   RUNSTATS WITH DISTRIBUTION PICK INCORRECT PLAN
IX77066   BYTE REVERSAL ERROR BETWEEN NT & AIX.
JR11726   SPORADIC TRAPS IN SQLNQ_TABSEL_OFN_CM
JR11797   UDB CLIENT THROUGH DDCS WITH SPM TO THE HOST, THE XA_RECOVER CALL FAILS.
JR11824   TRAP IN DOSCALL1.DLL DURING CTRL-C
IX77399   CRASH RECOVERY ENDS TOO EARLY.
JR11853   SYS3175 IN SQLBTERM FUNCTION WHILE ATTEMPTING TO BRING A DATBASE DOWN THAT HAS BEEN MARKED BAD.  THIS BRINGS INSTANCE DOWN
IX77333   HP: SHARED MEMORY PROBLEM - BACKWARD FIT UDB FIX FOR V2
IX71898   INCORRECT OUTPUT FOR FUNCTION LOG10
JR11810   UDB NT TAPE RESTORE RETURNS SQL2530 -- IMAGE CORRUPT.
IX76678   SQL1042 ON GET SNAPSHOT FOR APPLICATIONS ON SOLARIS 2.5.1 WITH SUN PATCH 104283 OR SOLARIS 2.6
IX78244   REORG OF COMPACT BLOB EXPANDS OBJECT TO NON-COMPACT SIZE
IX78307   CONNECT TO REMOTE DB FAILS WITHOUT AN ERROR.RETURNS TO A PROMPT.
IX79090   CHECK IN PROPER VERSION OF SIGNAL HANDLER IN JDBCSERVER.C
IX78836   ALTER TABLE ... NOT NULL DEFAULT CURRENT TIMESTAMP FAILS -193
JR12009   OS2 SMP:SQLOFMBLK RETURNS SQLO_INV_MEM TO SQLBINIT (PROBE:80)
IX79090   CHECK IN PROPER VERSION OF SIGNAL HANDLER IN JDBCSERVER.C
IX79235   INTERMITTENT SIGNAL 11 IN SQLULUMW
 314         0           124616      0           0           0           0           0   `
10          68          678         974         1286        1472        1666        1856        2490        100822      124616      copyright db2_02_01.sdk.c.al db2_02_01.sdk.c.size db2_02_01.sdk.c.prereq db2_02_01.sdk.cobol.prereq db2_02_01.sdk.cli.prereq db2_02_01.sdk.c.inventory lpp.README fixinfo lpp.fixinfo N DB2Rk $ $        K  ˸5 ˸5͸5           K     ./usr/lpp/db2_02_01/include/sql.h c/4.1.                    $          /******************************************************************************
** 
** Source File Name: SQL
** 
** (C) COPYRIGHT International Business Machines Corp. 1987, 1995
** All Rights Reserved
** Licensed Materials - Property of IBM
** 
** US Government Users Restricted Rights - Use, duplication or
** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
** 
** Function = Include File defining:
**              System Constants
**              National Language Support Information
**              SQLCA / SQLDA Constants
**              Interface to BINDER and PRECOMPILER
**              Error Message Retrieval Interface
**              Authorization Constants
** 
** Operating System: AIX
** 
*******************************************************************************/
#ifndef SQL_H_SQL
#define SQL_H_SQL

#ifdef __cplusplus
extern "C" {
#endif


/* Note: _SQLOLDCHAR defaults to 'char'.  See sqlsystm.h for details.         */

#include <stddef.h>                    
#include "sqlsystm.h"                  /* System dependent defines  */

#ifndef SQLCODE
#include "sqlca.h"                     /* Required include file    */
#endif

#pragma options align=power

/* System Constants                                                           */

#ifndef   SQL_RC_OK
#define SQL_RC_OK              0       /* successful execution                */
#endif

#define SQL_KEYPMAX            16      /* Maximum nbr of key parts in Index   */
#define SQL_KEYLMAX            255     /* Maximum key length                  */
#define SQL_SORTFLDLMT         254     /* Maximum size of field for sort      */
#define SQL_MAXRECL            4005    /* Maximum record length               */
#define SQL_MAXTABLES          15      /* Maximum nbr of tables in a SELECT   */
#define SQL_MAXSEL_ITEMS       255     /* Maximum nbr of items in a SELECT    */
#define SQL_MAXVARS_STMT       32767   /* Maximum nbr of Host Vars per stmt   */
#define SQL_MAXCOLS            255     /* Maximum nbr of columns in a table   */
#define SQL_MAXPARMS           90      /* Maximum nbr of parms in a function  */
#define SQL_MAX_STMT_SIZ       32765   /* Maximum statement size              */

#define SQL_SMALL_LENGTH       2       /* Size of a SMALLINT                  */
#define SQL_MAXSMALLVAL        32767   /* Maximum value of a SMALLINT         */
#define   SQL_MINSMALLVAL (-(SQL_MAXSMALLVAL)-1) /* Minimum value of a SMALLINT */
#define SQL_INT_LENGTH         4       /* Size of an INTEGER                  */
#define SQL_MAXINTVAL          2147483647 /* Maximum value of an INTEGER      */
#define   SQL_MININTVAL (-(SQL_MAXINTVAL)-1) /* Minimum value of an INTEGER  */
#define SQL_FLOAT_LENGTH       8       /* Size of a FLOAT                     */
#define SQL_DEFDEC_PRECISION   5       /* Default precision for DECIMAL       */
#define SQL_DEFDEC_SCALE       0       /* Default scale for DECIMAL           */
#define SQL_MAXDECIMAL         31      /* Maximum scale/prec. for DECIMAL     */
#define SQL_DEFCHAR            1       /* Default length for a CHAR           */
#define SQL_DEFWCHAR           1       /* Default length for a graphic        */
#define SQL_MAXCHAR            254     /* Maximum length of a CHAR            */
#define SQL_MAXLSTR            255     /* Maximum length of an LSTRING        */
#define SQL_MAXVCHAR           (SQL_MAXRECL-5) /* Maximum length of a         */
                                       /* VARCHAR                             */
#define SQL_MAXVGRAPH          2000    /* Maximum length of a VARGRAPHIC      */
#define SQL_MAXBLOB            2147483647 /* Max. length of a BLOB host var   */
#define SQL_MAXCLOB            2147483647 /* Max. length of a CLOB host var   */
#define SQL_MAXDBCLOB          1073741823 /* Max. length of an DBCLOB host    */
                                       /* var                                 */
#define SQL_LOBLOCATOR_LEN     4       /* Length of a LOB locator host var    */
#define SQL_LOBFILE_LEN        267     /* Length of a LOB file host var       */
#define SQL_VCHAROH            4       /* Overhead for VARCHAR in record      */
#define SQL_LONGMAX            32700   /* Maximum length of a LONG VARCHAR    */
#define SQL_LONGGRMAX          16350   /* Max. length of a LONG VARGRAPHIC    */
#define SQL_LVCHAROH           24      /* Overhead for LONG VARCHAR in        */
                                       /* record                              */
#define SQL_LOBCHAROH          312     /* Overhead for LOB in record          */
#define SQL_BLOB_MAXLEN        2147483647 /* BLOB maximum length, in bytes    */
#define SQL_CLOB_MAXLEN        2147483647 /* CLOB maximum length, in chars    */
#define SQL_DBCLOB_MAXLEN      1073741823 /* maxlen for dbcs lobs             */
#define SQL_TIME_LENGTH        3       /* Size of a TIME field                */
#define SQL_TIME_STRLEN        8       /* Size of a TIME field output         */
#define SQL_TIME_MINSTRLEN     5       /* Size of a non-USA TIME field        */
                                       /* output without seconds              */
#define SQL_DATE_LENGTH        4       /* Size of a DATE field                */
#define SQL_DATE_STRLEN        10      /* Size of a DATE field output         */
#define SQL_STAMP_LENGTH       10      /* Size of a TIMESTAMP field           */
#define SQL_STAMP_STRLEN       26      /* Size of a TIMESTAMP field output    */
#define SQL_STAMP_MINSTRLEN    19      /* Size of a TIMESTAMP field output    */
                                       /* without microseconds                */
#define SQL_BOOLEAN_LENGTH     1       /* Size of a BOOLEAN field             */
#define SQL_IND_LENGTH         2       /* Size of an indicator value          */

#define SQL_MAX_PNAME_LENGTH   254     /* Max size of Stored Proc Name        */
#define SQL_LG_IDENT           18      /* Maximum length of Long Identifer    */
#define SQL_SH_IDENT           8       /* Maximum length of Short Identifer   */
#define SQL_MN_IDENT           1       /* Minimum length of Identifiers       */
#define SQL_MAX_VAR_NAME       30      /* Max size of Host Variable Name      */
#define SQL_KILO_VALUE         1024    /* # of bytes in a kilobyte            */
#define SQL_MEGA_VALUE         1048576 /* # of bytes in a megabyte            */
#define SQL_GIGA_VALUE         1073741824 /* # of bytes in a gigabyte         */

#define SQLB_MAX_CONTAIN_NAME_SZ 256   /* size of container name for api's    */
                                       /* (includes 1 byte for C NULL         */
                                       /* terminator)                         */

/* Codepages                                                                  */
#define SQL_CP_367             367     /* Codepage 367 - EUC single byte      */
#define SQL_CP_437             437     /* Codepage 437 - US, Europe           */
#define SQL_CP_813             813     /* Codepage 813 - AIX Greece           */
#define SQL_CP_819             819     /* Codepage 819 - ISO 8859-1           */
#define SQL_CP_850             850     /* Codepage 850 - International PC     */
#define SQL_CP_855             855     /* Codepage 855 - OS2 Cyrillic         */
#define SQL_CP_852             852     /* Codepage 852 - OS2 Latin2           */
#define SQL_CP_857             857     /* Codepage 857 - OS2 Turkey           */
#define SQL_CP_860             860     /* Codepage 860 - Portuguese           */
#define SQL_CP_862             862     /* Codepage 862 - OS2 Hebrew           */
#define SQL_CP_863             863     /* Codepage 863 - Canadian-French      */
#define SQL_CP_864             864     /* Codepage 863 - OS2 Arabic           */
#define SQL_CP_865             865     /* Codepage 865 - Norway, Denmark      */
#define SQL_CP_866             866     /* Codepage 866 - Russia               */
#define SQL_CP_869             869     /* Codepage 869 - OS2 Greece           */
#define SQL_CP_874             874     /* Codepage 874 - OS2/AIX Thailand     */
#define SQL_CP_891             891     /* Codepage 891 - Korean               */
#define SQL_CP_897             897     /* Codepage 897 - Japanese             */
#define SQL_CP_903             903     /* Codepage 903 - Chinese              */
#define SQL_CP_904             904     /* Codepage 904 - Taiwan               */
#define SQL_CP_912             912     /* Codepage 912 - AIX Latin2           */
#define SQL_CP_915             915     /* Codepage 915 - AIX Cyrillic         */
#define SQL_CP_916             916     /* Codepage 916 - AIX Hebrew           */
#define SQL_CP_920             920     /* Codepage 920 - AIX Turkey           */
#define SQL_CP_921             921     /* Codepage 921 - Latvia, Lithuania    */
#define SQL_CP_922             922     /* Codepage 922 - Estonia              */
#define SQL_CP_1004            1004    /* Codepage 1004 - MS-WINDOWS          */
#define SQL_CP_1040            1040    /* Codepage 1040 - Extended Korean     */
#define SQL_CP_1041            1041    /* Codepage 1041 - Extended Japanese   */
#define SQL_CP_1042            1042    /* Codepage 1042 - Extended Chinese    */
#define SQL_CP_1043            1043    /* Codepage 1043 - Extended Taiwan     */
#define SQL_CP_1046            1046    /* Codepage 1046 - AIX Arabic          */
#define SQL_CP_1051            1051    /* Codepage 1051 - HP Roman8           */
#define SQL_CP_1088            1088    /* Codepage 1088 - Korea Std           */
#define SQL_CP_1089            1089    /* Codepage 1089 - AIX Arabic          */
#define SQL_CP_1114            1114    /* Codepage 1114 - Taiwan Big-5        */
#define SQL_CP_1115            1115    /* Codepage 1115 - China GB            */
#define SQL_CP_1126            1126    /* Codepage 1126 - Windows Korean Std  */
#define SQL_CP_1250            1250    /* Codepage 1250 - Windows Latin-2     */
#define SQL_CP_1251            1251    /* Codepage 1251 - Windows Cyrillic    */
#define SQL_CP_1252            1252    /* Codepage 1252 - Windows Latin-1     */
#define SQL_CP_1253            1253    /* Codepage 1253 - Windows Greek       */
#define SQL_CP_1254            1254    /* Codepage 1254 - Windows Turkish     */
#define SQL_CP_1255            1255    /* Codepage 1255 - Windows Hebrew      */
#define SQL_CP_1256            1256    /* Codepage 1256 - Windows Arabic      */
#define SQL_CP_1275            1275    /* Codepage 1275 - Mac Latin-1         */
#define SQL_CP_1280            1280    /* Codepage 1280 - Mac Greek           */
#define SQL_CP_1281            1281    /* Codepage 1281 - Mac Turkish         */
#define SQL_CP_1282            1282    /* Codepage 1282 - Mac Latin-2         */
#define SQL_CP_1283            1283    /* Codepage 1283 - Mac Cyrillic        */

/* DBCS Codepages                                                             */
#define SQL_CP_926             926     /* Codepage 926 - Korean               */
#define SQL_CP_951             951     /* Codepage 951 - New Korean           */
#define SQL_CP_301             301     /* Codepage 301 - Japanese             */
#define SQL_CP_928             928     /* Codepage 928 - Chinese              */
#define SQL_CP_927             927     /* Codepage 927 - Taiwan               */
#define SQL_CP_941             941     /* Codepage 941 - Japanese             */
#define SQL_CP_947             947     /* Codepage 947 - Taiwan Big-5         */
#define SQL_CP_971             971     /* Codepage 971 - Korean 5601          */
#define SQL_CP_1351            1351    /* Codepage 1351 - Japanese            */
#define SQL_CP_1362            1362    /* Codepage 1362 - Korean Windows      */
#define SQL_CP_1380            1380    /* Codepage1380 - China GB             */
#define SQL_CP_1382            1382    /* Codepage1382 - Simp Chinese GB      */
#define SQL_CP_13488           13488   /* Codepage13488 - UCS-2               */

/* Combined Codepages                                                         */
#define SQL_CP_934             934     /* Codepage 891 + 926 - Korean         */
#define SQL_CP_949             949     /* CP 1088 + 951 - Korean Std          */
#define SQL_CP_932             932     /* Codepage 897 + 301 - Japanese       */
#define SQL_CP_936             936     /* Codepage 903 + 928 - Chinese        */
#define SQL_CP_938             938     /* Codepage 904 + 927 - Taiwan         */
#define SQL_CP_944             944     /* Codepage 1040 + 926 - Ext.Korean    */
#define SQL_CP_942             942     /* Codepage 1041 + 301 - Ext.Japanese  */
#define SQL_CP_943             943     /* Codepage  897 + 941 - Ext.Japanese  */
#define SQL_CP_946             946     /* Codepage 1042 + 928 - Ext.Chinese   */
#define SQL_CP_948             948     /* Codepage 1043 + 927 - Ext.Taiwan    */
#define SQL_CP_950             950     /* Codepage 1114 + 947 - Taiwan Big5   */
#define SQL_CP_954             954     /* Codepage 954 + 13488 - euc Japan    */
#define SQL_CP_964             964     /* Codepage 964 + 13488 - euc Taiwan   */
#define SQL_CP_970             970     /* Codepage  367 + 971 - Korean 5601   */
#define SQL_CP_1363            1363    /* Codepage 1363 - Korean Windows      */
#define SQL_CP_1381            1381    /* Codepage 1115 +1380 - China GB      */
#define SQL_CP_1383            1383    /* Codepage  367 +1382 - Chinese GB    */

#define SQL_CP_5039            5039    /* Codepage  1041 + 1351 - Japanese    */
/* Datastream Types                                                           */
#define SQL_SBC_PC             0       /* Single byte PC                      */
#define SQL_JPN_PC             1       /* Japanese-PC                         */
#define SQL_CHN_PC             2       /* Chinese-PC                          */
#define SQL_KOR_PC             3       /* Korean-PC                           */
#define SQL_KSC_PC             4       /* New Korean-PC                       */
#define SQL_KR5_PC             5       /* Korean 5601                         */
#define SQL_TWN_PC             6       /* Taiwan Big-5                        */
#define SQL_CGB_PC             7       /* China GB                            */
#define SQL_CGBA_PC            8       /* China GB on AIX                     */
#define SQL_EUCJP_PC           9       /* Japan euc                           */
#define SQL_EUCTW_PC           10      /* Taiwan euc                          */
#define SQL_UCS2_PC            11      /* UCS-2                               */
#define SQL_KSC2_PC            12      /* Korean Windows                      */
#define SQL_UNKN_PC            255     /* Unknown                             */

/* AIX codeset & locale lengths                                               */
#define SQL_CODESET_LEN        9
#define SQL_LOCALE_LEN         5

/* SQLCA Constants                                                            */
#ifndef SQL_RC_INVALID_SQLCA
#endif

/* Size of SQLCA                                                              */
#define SQLCA_SIZE             sizeof(struct sqlca)

/* SQL Error message token delimiter                                          */
#define SQL_ERRMC_PRES ((char) 0xFF) /* delimiter for string entry */

/* Offset in SQLERRD - Diagnostic information                                 */
#define SQL_ERRD_RC            0       /* return code                         */
#define SQL_ERRD_REAS          1       /* reason code                         */
#define SQL_ERRD_CNT           2       /* nbr rows inserted/updated/deleted   */
#define SQL_ERRD_OPT_CARD      2       /* optimizer estimate of # rows        */
#define SQL_ERRD_OPTM          3       /* obsolete -- do not use --           */
#define SQL_ERRD_OPT_TOTCOST   3       /* optimzer estimate of total cost     */
#define SQL_ERRD_DCNT          4       /* nbr of cascaded deletes/updates     */
#define SQL_ERRD_LINE          4       /* line number for recompile error     */
#define SQL_ERRD_DIAG          5       /* diagnostics                         */

/* Indexes in SQLWARN - Warning flags                                         */
#define SQL_WARN_ANY           0       /* composite - set if any warnings     */
#define SQL_WARN_TRUNC         1       /* string column truncated             */
#define SQL_WARN_NUL           2       /* null values eliminated              */
#define SQL_WARN_MISM          3       /* nbr of columns/host vars mismatch   */
#define SQL_WARN_ALLR          4       /* no WHERE clause in update/delete    */
#define SQL_WARN_DATE          6       /* date has been truncated             */
#define SQL_WARN_SUB           8       /* character conversion substitution   */
#define SQL_WARN_SQLCA         10      /* SQLCA conversion error              */

/* Values for Warning flags in SQLWARN                                        */
#define SQL_WARNING            'W'     /* warning indicator                   */
#define SQL_NULL_TRN           'N'     /* null terminator truncated warning   */
#define SQL_TRN_APP_LEN        'X'     /* truncation warning with             */
                                       /* application context length          */
                                       /* returned in sqlind                  */
#define SQL_NO_WARN            ' '     /* no warning indicator                */

/* SQLDA Constants                                                            */

/* Increment for type with null indicator                                     */
#define SQL_TYP_NULINC         1

/* Variable Types                                                             */
#define SQL_TYP_DATE           384     /* DATE                                */
#define SQL_TYP_NDATE          (SQL_TYP_DATE+SQL_TYP_NULINC)

#define SQL_TYP_TIME           388     /* TIME                                */
#define SQL_TYP_NTIME          (SQL_TYP_TIME+SQL_TYP_NULINC)

#define SQL_TYP_STAMP          392     /* TIMESTAMP                           */
#define SQL_TYP_NSTAMP         (SQL_TYP_STAMP+SQL_TYP_NULINC)

#define SQL_TYP_CGSTR          400     /* C NUL-terminated graphic str        */
#define SQL_TYP_NCGSTR         (SQL_TYP_CGSTR+SQL_TYP_NULINC)

#define SQL_TYP_BLOB           404     /* BLOB - varying length string        */
#define SQL_TYP_NBLOB          (SQL_TYP_BLOB+SQL_TYP_NULINC)

#define SQL_TYP_CLOB           408     /* CLOB - varying length string        */
#define SQL_TYP_NCLOB          (SQL_TYP_CLOB+SQL_TYP_NULINC)

#define SQL_TYP_DBCLOB         412     /* DBCLOB - varying length string      */
#define SQL_TYP_NDBCLOB        (SQL_TYP_DBCLOB+SQL_TYP_NULINC)

#define SQL_TYP_VARCHAR        448     /* VARCHAR(i) - varying length string  */
                                       /* (2 byte length)                     */
#define SQL_TYP_NVARCHAR       (SQL_TYP_VARCHAR+SQL_TYP_NULINC)

#define SQL_TYP_CHAR           452     /* CHAR(i) - fixed length string       */
#define SQL_TYP_NCHAR          (SQL_TYP_CHAR+SQL_TYP_NULINC)

#define SQL_TYP_LONG           456     /* LONG VARCHAR - varying length       */
                                       /* string                              */
#define SQL_TYP_NLONG          (SQL_TYP_LONG+SQL_TYP_NULINC)

#define SQL_TYP_CSTR           460     /* varying length string for C (null   */
                                       /* terminated)                         */
#define SQL_TYP_NCSTR          (SQL_TYP_CSTR+SQL_TYP_NULINC)

#define SQL_TYP_VARGRAPH       464     /* VARGRAPHIC(i) - varying length      */
                                       /* graphic string (2 byte length)      */
#define SQL_TYP_NVARGRAPH      (SQL_TYP_VARGRAPH+SQL_TYP_NULINC)

#define SQL_TYP_GRAPHIC        468     /* GRAPHIC(i) - fixed length graphic   */
                                       /* string                              */
#define SQL_TYP_NGRAPHIC       (SQL_TYP_GRAPHIC+SQL_TYP_NULINC)

#define SQL_TYP_LONGRAPH       472     /* LONG VARGRAPHIC(i) - varying        */
                                       /* length graphic string               */
#define SQL_TYP_NLONGRAPH      (SQL_TYP_LONGRAPH+SQL_TYP_NULINC)

#define SQL_TYP_LSTR           476     /* varying length string for Pascal    */
                                       /* (1-byte length)                     */
#define SQL_TYP_NLSTR          (SQL_TYP_LSTR+SQL_TYP_NULINC)

#define SQL_TYP_FLOAT          480     /* FLOAT - 8-byte floating point       */
#define SQL_TYP_NFLOAT         (SQL_TYP_FLOAT+SQL_TYP_NULINC)

#define SQL_TYP_DECIMAL        484     /* DECIMAL (m,n)                       */
#define SQL_TYP_NDECIMAL       (SQL_TYP_DECIMAL+SQL_TYP_NULINC)

#define SQL_TYP_ZONED          488     /* Zoned Decimal -> DECIMAL (m,n)      */
#define SQL_TYP_NZONED         (SQL_TYP_ZONED+SQL_TYP_NULINC)

#define SQL_TYP_INTEGER        496     /* INTEGER - 4-byte signed integer     */
#define SQL_TYP_NINTEGER       (SQL_TYP_INTEGER+SQL_TYP_NULINC)

#define SQL_TYP_SMALL          500     /* SMALLINT - 2-byte signed integer    */
#define SQL_TYP_NSMALL         (SQL_TYP_SMALL+SQL_TYP_NULINC)

#define SQL_TYP_NUMERIC        504     /* NUMERIC -> DECIMAL (m,n)            */
#define SQL_TYP_NNUMERIC       (SQL_TYP_NUMERIC+SQL_TYP_NULINC)

#define SQL_TYP_BLOB_FILE      804     /* BLOB File - Binary Large Object     */
                                       /* File                                */
#define SQL_TYP_NBLOB_FILE     (SQL_TYP_BLOB_FILE+SQL_TYP_NULINC)

#define SQL_TYP_CLOB_FILE      808     /* CLOB File - Char Large Object File  */
#define SQL_TYP_NCLOB_FILE     (SQL_TYP_CLOB_FILE+SQL_TYP_NULINC)

#define SQL_TYP_DBCLOB_FILE    812     /* DBCLOB File - Double Byte Char      */
                                       /* Large Object File                   */
#define SQL_TYP_NDBCLOB_FILE   (SQL_TYP_DBCLOB_FILE+SQL_TYP_NULINC)

#define SQL_TYP_BLOB_LOCATOR   960     /* BLOB locator                        */
#define SQL_TYP_NBLOB_LOCATOR  (SQL_TYP_BLOB_LOCATOR+SQL_TYP_NULINC)

#define SQL_TYP_CLOB_LOCATOR   964     /* CLOB locator                        */
#define SQL_TYP_NCLOB_LOCATOR  (SQL_TYP_CLOB_LOCATOR+SQL_TYP_NULINC)

#define SQL_TYP_DBCLOB_LOCATOR 968     /* DBCLOB locator                      */
#define SQL_TYP_NDBCLOB_LOCATOR (SQL_TYP_DBCLOB_LOCATOR+SQL_TYP_NULINC)

#define SQL_LOBTOKEN_LEN       SQL_LOBLOCATOR_LEN
#define SQL_TYP_BLOB_TOKEN     SQL_TYP_BLOB_LOCATOR
#define SQL_TYP_NBLOB_TOKEN    SQL_TYP_NBLOB_LOCATOR
#define SQL_TYP_CLOB_TOKEN     SQL_TYP_CLOB_LOCATOR
#define SQL_TYP_NCLOB_TOKEN    SQL_TYP_NCLOB_LOCATOR
#define SQL_TYP_DBCLOB_TOKEN   SQL_TYP_DBCLOB_LOCATOR
#define SQL_TYP_NDBCLOB_TOKEN  SQL_TYP_NDBCLOB_LOCATOR
#define SQL_NCLOB_MAXLEN       SQL_DBCLOB_MAXLEN
#define SQL_LOBHANDLE_LEN      SQL_LOBTOKEN_LEN
#define SQL_TYP_BLOB_HANDLE    SQL_TYP_BLOB_TOKEN
#define SQL_TYP_NBLOB_HANDLE   SQL_TYP_NBLOB_TOKEN
#define SQL_TYP_CLOB_HANDLE    SQL_TYP_CLOB_TOKEN
#define SQL_TYP_NCLOB_HANDLE   SQL_TYP_NCLOB_TOKEN
#define SQL_TYP_DBCLOB_HANDLE  SQL_TYP_DBCLOB_TOKEN
#define SQL_TYP_NDBCLOB_HANDLE SQL_TYP_NDBCLOB_TOKEN

/* Return Codes for sqlabndx and sqlaprep                                     */
#define SQLA_RC_OPT_IGNORED    20      /* The option(s) specified are not     */
                                       /* supported by the target  database   */
                                       /* and will be ignored                 */
#define SQLA_RC_BINDWARN       25      /* Bind execution succeeded with       */
                                       /* warnings.                           */
#define SQLA_RC_PREPWARN       25      /* Precompilation succeeded with       */
                                       /* warnings.                           */
#define SQLA_RC_BINDERROR      -1      /* Bind execution failed               */
#define SQLA_RC_PREPERROR      -1      /* Precompilation failed               */
#define SQLA_RC_BAD_BINDNAME   -2      /* Invalid bind file                   */
#define SQLA_RC_BAD_DBNAME     -3      /* Invalid database                    */
#define SQLA_RC_BAD_MSGNAME    -5      /* Invalid message file                */
#define SQLA_RC_BAD_FORMAT     -6      /* Invalid format                      */
#define SQLA_RC_OPEN_ERROR     -31     /* Error opening list file             */
#define SQLA_RC_MFILE_OPEN_ERR -35     /* Error opening message file          */
#define SQLA_RC_FILE_NAME_BAD  -36     /* Source file name is invalid         */
#define SQLA_RC_BAD_BNDFILE    -39     /* Bind file corrupted                 */
#define SQLA_RC_LIST_ERROR     -40     /* Bind list errors                    */
#define SQLA_RC_INTERRUPT      -94     /* Interrupt                           */
#define SQLA_RC_OSERROR        -1086   /* System error                        */
#define SQLA_RC_PREP_BIND_BUSY -1392   /* Prep/Bind already in use            */
#define SQLA_RC_OPTION_LEN_BAD -4903   /* Invalid parm. length                */
#define SQLA_RC_OPTION_PTR_BAD -4904   /* Invalid parm. ptr                   */
#define SQLA_RC_OPTION_SIZE_BAD -4905  /* Invalid parm. size                  */
#define SQLA_RC_OPTION_DATA_BAD -4917  /* Invalid parm. data                  */
#define SQLA_RC_OPTION_INVALID -4930   /* Invalid option or option value      */
#define SQLA_RC_SDK_LICENSE    -8005   /* No SDK/6000 license                 */

/* Values used for the date/time format parameter of sqlabind() ** OBSOLETE   */
/* **                                                                         */
#define SQL_FMT_DEF            "DEF"   /* FORMAT = Default for Country Code   */
#define SQL_FMT_USA            "USA"   /* FORMAT = USA                        */
#define SQL_FMT_EUR            "EUR"   /* FORMAT = EUR                        */
#define SQL_FMT_ISO            "ISO"   /* FORMAT = ISO                        */
#define SQL_FMT_JIS            "JIS"   /* FORMAT = JIS                        */
#define SQL_FMT_LOC            "LOC"   /* FORMAT = LOCAL                      */

/* The size of a date/time format buffer                                      */
#define SQL_FMT_LENGTH         3

/* Structures used system wide                                                */

#ifndef SQL_SQLDBCHAR_DEFN
#define SQL_SQLDBCHAR_DEFN
  typedef unsigned short sqldbchar;
#endif

SQL_STRUCTURE sqlchar                  /* General-purpose VARCHAR for         */
                                       /* casting                             */
{
        short                  length;
        _SQLOLDCHAR            data[1];
};

SQL_STRUCTURE sqlgraphic               /* General-purpose VARGRAPHIC for      */
                                       /* casting                             */
{
        short                  length;
#ifdef SQL_WCHART_CONVERT
        wchar_t                data[1];
#else
        sqldbchar              data[1];
#endif
};

SQL_STRUCTURE sqllob                   /* General-purpose LOB for casting     */
{
        unsigned long          length;
        char                   data[1];
};

SQL_STRUCTURE sqldbclob                /* General-purpose DBCLOB for casting  */
{
        unsigned long          length;
#ifdef SQL_WCHART_CONVERT
        wchar_t                data[1];
#else
        sqldbchar              data[1];
#endif
};

SQL_STRUCTURE sqlfile                  /* File reference structure for LOBs   */
{
        unsigned long          name_length;
        unsigned long          data_length;
        unsigned long          file_options;
        char                   name[255];
};

/* Values used for file_options in the sqlfile structure                      */
#define SQL_FILE_READ          2       /* Input file to read from             */
#define SQL_FILE_CREATE        8       /* Output file - new file to be        */
                                       /* created                             */
#define SQL_FILE_OVERWRITE     16      /* Output file - overwrite existing    */
                                       /* file or create a new file if it     */
                                       /* doesn't exist                       */
#define SQL_FILE_APPEND        32      /* Output file - append to an          */
                                       /* existing file or create a new file  */
                                       /* if it doesn't exist                 */

/* Structure used to store binder options when calling sqlabndr()             */
/* or sqlabndx() or to store precompile options when calling                  */
/* sqlaprep().                                                                */

#define sqlbindopt sqloptions

#ifndef SQL_BIND_OPTS

SQL_STRUCTURE sqloptheader     /* Header for sqlopt structure */
{
   unsigned long allocated; /* Number of options allocated */
   unsigned long used; /* Number of options used */
};

SQL_STRUCTURE sqloptions       /* bind/prep option          */
{
   unsigned long type; /* Type  of bind/prep option */
   unsigned long val; /* Value of bind/prep option */
};

SQL_STRUCTURE sqlopt
{
   SQL_STRUCTURE sqloptheader header;     /* Header for sqlopt structure */
   SQL_STRUCTURE sqloptions   option[1];  /* Array of bind/prep options  */
};

#define SQL_BIND_OPTS
#endif

/* Values used for option[n].type in the sqloptions structure                 */
/* of sqlabndx() and sqlaprep().                                              */
#define SQL_DATETIME_OPT       1       /* Option for date/time format - bind  */
                                       /* and precompile option               */
#define SQL_STANDARDS_OPT      2       /* Option for standards level          */
                                       /* compliance - precompile option      */
                                       /* only                                */
#define SQL_ISO_OPT            4       /* Option for isolation level - bind   */
                                       /* and precompile option               */
#define SQL_BLOCK_OPT          5       /* Option for record blocking - bind   */
                                       /* and precompile option               */
#define SQL_GRANT_OPT          6       /* Option for granting privileges -    */
                                       /* bind option only                    */
#define SQL_FLAG_OPT           8       /* Option for the Flagger -            */
                                       /* precompile option only              */
#define SQL_CNULREQD_OPT       11      /* Option for adding NULLs to strings  */
                                       /* - bind option only                  */
#define SQL_CONNECT_OPT        16      /* Specifies whether one or multiple   */
                                       /* connections are allowed             */
                                       /* similtaneously within a unit of     */
                                       /* work.                               */
#define SQL_RULES_OPT          17      /* Specifies the set of rules used     */
                                       /* for connection to multiple          */
                                       /* databases within a single unit of   */
                                       /* work                                */
#define SQL_DISCONNECT_OPT     18      /* Specifies which of multiple         */
                                       /* databases connected to will be      */
                                       /* disconnected when a COMMIT or       */
                                       /* ROLLBACK is issued.                 */
#define SQL_SYNCPOINT_OPT      19      /* Specifies what syncpoint option     */
                                       /* (for example one phase or two       */
                                       /* phase) will be used                 */
#define SQL_BIND_OPT           20      /* Option to create a bind file -      */
                                       /* precompile option only              */
#define SQL_SAA_OPT            21      /* Option specifies SAA/non-SAA        */
                                       /* compatibility - FORTRAN precompile  */
                                       /* option only                         */
#define SQL_PKG_OPT            23      /* Option to create a package with a   */
                                       /* specific name - precompile option   */
                                       /* only                                */
#define SQL_OPTIM_OPT          24      /* Option to specify SQLDA             */
                                       /* optimization - precompile option    */
                                       /* only                                */
#define SQL_SYNTAX_OPT         25      /* Option to not create a package or   */
                                       /* bind file - precompile option only  */
#define SQL_SQLERROR_OPT       SQL_SYNTAX_OPT /* Indicates under what         */
                                       /* conditions a package will be be     */
                                       /* created - bind and precompile       */
                                       /* option                              */
#define SQL_LINEMACRO_OPT      26      /* Option to suppress #line macro      */
                                       /* generation in modified source file  */
                                       /* - C precompile option only          */
#define SQL_NO_OPT             27      /* 'No-op' option - ignore this entry  */
                                       /* in the option array - bind and      */
                                       /* precompile option                   */
#define SQL_LEVEL_OPT          30      /* Level of a module - precompile      */
                                       /* option only                         */
#define SQL_COLLECTION_OPT     31      /* Package collection identifier -     */
                                       /* precompile option only              */
#define SQL_VERSION_OPT        32      /* Package version identifier -        */
                                       /* precompile option only              */
#define SQL_OWNER_OPT          33      /* Package owner authorization         */
                                       /* identifier - bind and precompile    */
                                       /* option                              */
#define SQL_SCHEMA_OPT         SQL_OWNER_OPT /* Synonym for owner - bind and  */
                                       /* precompile option                   */
#define SQL_QUALIFIER_OPT      34      /* Authorization identifier that is    */
                                       /* to be used as a qualifier for       */
                                       /* unqualified objects - bind and      */
                                       /* precompile option                   */
#define SQL_CATALOG_OPT        SQL_QUALIFIER_OPT /* Synonym for qualifier -   */
                                       /* bind and precompile option          */
#define SQL_TEXT_OPT           35      /* Package description - bind and      */
                                       /* precompile option                   */
#define SQL_VALIDATE_OPT       40      /* Indicates when object validation    */
                                       /* occurs - bind and precompile        */
                                       /* option                              */
#define SQL_EXPLAIN_OPT        41      /* Determines whether information      */
                                       /* will be produced about how the SQL  */
                                       /* statements in a package will be     */
                                       /* executed - bind and precompile      */
                                       /* option                              */
#define SQL_ACTION_OPT         42      /* Indicates whether a package is to   */
                                       /* be added or replaced - bind and     */
                                       /* precompile option                   */
#define SQL_REPLVER_OPT        44      /* Replaces a specific version of a    */
                                       /* package - bind and precompile       */
                                       /* option                              */
#define SQL_RETAIN_OPT         45      /* Indicates whether EXECUTE           */
                                       /* authorities are to be preserved     */
                                       /* when a package is replaced - bind   */
                                       /* and precompile option               */
#define SQL_RELEASE_OPT        46      /* Indicates whether resources are     */
                                       /* released at each COMMIT or when     */
                                       /* the application  terminates - bind  */
                                       /* and precompile option               */
#define SQL_DEGREE_OPT         47      /* Specifies whether or not the query  */
                                       /* is executed using I/O parallelism   */
                                       /*  bind and precompile option         */
#define SQL_STRDEL_OPT         50      /* Designates whether an apostrophe    */
                                       /* or quote will be used as a string   */
                                       /* delimiter - bind and precompile     */
                                       /* option                              */
#define SQL_DECDEL_OPT         51      /* Designates whether a period or      */
                                       /* comma will be used as a decimal     */
                                       /* point indicator - bind and          */
                                       /* precompile option                   */
#define SQL_CHARSUB_OPT        55      /* Designates default character        */
                                       /* subtype that is to be used for      */
                                       /* column definitions in the CREATE    */
                                       /* and ALTER TABLE SQL statements -    */
                                       /* bind and precompile option          */
#define SQL_CCSIDS_OPT         56      /* Designates what CCSID will be used  */
                                       /* for single byte characters for      */
                                       /* character column definitions        */
                                       /* without a specific CCSID clause in  */
                                       /* the CREATE and ALTER TABLE SQL      */
                                       /* statements - bind and precompile    */
                                       /* option                              */
#define SQL_CCSIDM_OPT         57      /* Designates what CCSID will be used  */
                                       /* for mixed byte characters for       */
                                       /* character column definitions        */
                                       /* without a specific CCSID clause in  */
                                       /* the CREATE and ALTER TABLE SQL      */
                                       /* statements - bind and precompile    */
                                       /* option                              */
#define SQL_CCSIDG_OPT         58      /* Designates what CCSID will be used  */
                                       /* for double byte characters for      */
                                       /* character column definitions        */
                                       /* without a specific CCSID clause in  */
                                       /* the CREATE and ALTER TABLE SQL      */
                                       /* statements - bind and precompile    */
                                       /* option                              */
#define SQL_DEC_OPT            59      /* Specifies maximum precision to be   */
                                       /* used in decimal arithmetic          */
                                       /* operations - bind and precompile    */
                                       /* option                              */
#define SQL_WCHAR_OPT          60      /* Specifies handling of graphic       */
                                       /* vars. - precompile only             */
#define SQL_DYNAMICRULES_OPT   61      /* Specifies which authorization       */
                                       /* identifier to use when dynamic SQL  */
                                       /* in a package is executed. Owner of  */
                                       /* package or authid executing         */
                                       /* package - bind and precompile       */
                                       /* option                              */
#define SQL_INSERT_OPT         62      /* Buffers VALUE inserts - bind and    */
                                       /* precompile option for DB2/PE        */
                                       /* servers only                        */
#define SQL_EXPLSNAP_OPT       63      /* Capture explain snapshot - bind     */
                                       /* and precompile option               */
#define SQL_FUNCTION_PATH      64      /* Path for user-defined function      */
                                       /* resolution - bind and precompile    */
                                       /* option                              */
#define SQL_SQLWARN_OPT        65      /* Disable prepare-time SQL warnings   */
                                       /*  bind and precompile option         */
#define SQL_QUERYOPT_OPT       66      /* Set query optimization class -      */
                                       /* bind and precompile option          */
#define SQL_TARGET_OPT         67      /* Target compiler - precompile        */
                                       /* option                              */
#define SQL_PREP_OUTPUT_OPT    68      /* Name of precompiler output file -   */
                                       /* precompile option                   */

/* Values used for option[n].val when option[n].type is                       */
/* SQL_DATETIME_OPT. These can also be used for the date/time                 */
/* format parameter of sqlabind().                                            */

#define SQL_DATETIME_DEF       48      /* FORMAT = Default for Country Code   */
#define SQL_DATETIME_USA       49      /* FORMAT = USA                        */
#define SQL_DATETIME_EUR       50      /* FORMAT = EUR                        */
#define SQL_DATETIME_ISO       51      /* FORMAT = ISO                        */
#define SQL_DATETIME_JIS       52      /* FORMAT = JIS                        */
#define SQL_DATETIME_LOC       53      /* FORMAT = LOCAL                      */

/* The following constants are here for backwards compatbility with earlier   */
/* releases.                                                                  */

#define SQL_FRMT_OPT           SQL_DATETIME_OPT
#define SQL_FMT_0              SQL_DATETIME_DEF
#define SQL_FMT_1              SQL_DATETIME_USA
#define SQL_FMT_2              SQL_DATETIME_EUR
#define SQL_FMT_3              SQL_DATETIME_ISO
#define SQL_FMT_4              SQL_DATETIME_JIS
#define SQL_FMT_5              SQL_DATETIME_LOC

/* Values used for option[n].val when option[n].type is SQL_STANDARDS_OPT.    */
#define SQL_SAA_COMP           0       /* SAA Level 1 Database CPI            */
#define SQL_MIA_COMP           1       /* MIA                                 */

/* Values used for option[n].val when option[n].type is SQL_ISO_OPT           */
#define SQL_REP_READ           0       /* Repeatable read level               */
#define SQL_CURSOR_STAB        1       /* Cursor stability level              */
#define SQL_UNCOM_READ         2       /* Uncommitted read level              */
#define SQL_READ_STAB          3       /* Read stability level                */
#define SQL_NO_COMMIT          4       /* No Commit level      l              */

/* Values used for option[n].val when option[n].type is SQL_BLOCK_OPT         */
#define SQL_BL_UNAMBIG         0       /* Block Unambiguous cursors           */
#define SQL_BL_ALL             1       /* Block All cursors                   */
#define SQL_NO_BL              2       /* Block No cursors                    */

/* Values used for option[n].val when option[n].type is SQL_FLAG_OPT          */
#define SQL_MVSDB2V23_SYNTAX   4       /* Flagger check against MVS           */
#define SQL_MVSDB2V31_SYNTAX   5       /* DB2 V2.3, V3.1 or V4.1 SQL          */
#define SQL_MVSDB2V41_SYNTAX   6       /* syntax                              */

/* Values used for option[n].val when option[n].type is SQL_CNULREQD_OPT      */
#define SQL_CNULREQD_NO        0       /* C NULL value not required           */
#define SQL_CNULREQD_YES       1       /* C NULL value required               */

/* Values used for option[n].val when option[n].type is SQL_SAA_OPT.          */
#define SQL_SAA_NO             0       /* SQLCA definition not SAA            */
                                       /* compatible                          */
#define SQL_SAA_YES            1       /* SQLCA definition is SAA compatible  */

/* Values used for option[n].val when option[n].type is SQL_OPTIM_OPT.        */
#define SQL_DONT_OPTIMIZE      0       /* Do not optimize SQLDA               */
                                       /* initialization                      */
#define SQL_OPTIMIZE           1       /* Optimize SQLDA initialization       */

/* Values used for option[n].val when option[n].type is SQL_SYNTAX_OPT.       */
#define SQL_NO_SYNTAX_CHECK    0       /* Create a package and/or a bind      */
                                       /* file                                */
#define SQL_SYNTAX_CHECK       1       /* Do not create a package or bind     */
                                       /* file                                */

/* Values used for option[n].val when option[n].type is SQL_LINEMACRO_OPT.    */
#define SQL_NO_LINE_MACROS     0       /* Do not generate #line macros in     */
                                       /* modified source file                */
#define SQL_LINE_MACROS        1       /* Generate #line macros in modified   */
                                       /* source file                         */

/* Values used for option[n].val when option[n].type is SQL_WCHAR_OPT.        */
#define SQL_WCHAR_NOCONVERT    0       /* graphic variable not converted      */
#define SQL_WCHAR_CONVERT      1       /* graphic variable converted          */

/* Maximum sqlchar length for option[n].val when option[n].type is SQL_LEVEL  */
/* OPT                                                                        */
#define SQL_MAX_LEVEL          8

/* Values used for option[n].val when option[n].type is SQL_CONNECT_OPT       */
#define SQL_DEFERRED_PREPARE_YES 1     /* Dynamic SQL statements will be      */
                                       /* chained.                            */
#define SQL_DEFERRED_PREPARE_NO 2      /* Dynamic SQL statements will not be  */
                                       /* chained.                            */
#define SQL_DEFERRED_PREPARE_ALL 3     /* Dynamic SQL statements will be      */
                                       /* chained in all cases.  The          */
                                       /* application must not allocate host  */
                                       /* vars a FETCH SQLDA until after the  */
                                       /* OPEN statement for the cursor.      */

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* COLLECTION_OPT                                                             */
#define SQL_MAX_COLLECTION     8

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* VERSION_OPT                                                                */
#define SQL_MAX_VERSION        254

/* Maximum sqlchar length for option[n].val when option[n].type is SQL_OWNER  */
/* OPT                                                                        */
#define SQL_MAX_OWNER          8

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* SCHEMA_OPT                                                                 */
#define SQL_MAX_SCHEMA         SQL_MAX_OWNER

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* QUALIFIER_OPT                                                              */
#define SQL_MAX_QUALIFIER      18

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* CATALOG_OPT                                                                */
#define SQL_MAX_CATALOG        SQL_MAX_QUALIFIER

/* Maximum sqlchar length for option[n].val when option[n].type is SQL_TEXT   */
/* OPT                                                                        */
#define SQL_MAX_TEXT           255

/* Values used for option[n].val when option[n].type is SQL_VALIDATE_OPT      */
#define SQL_VALIDATE_BIND      0       /* Validate objects during BIND        */
#define SQL_VALIDATE_RUN       1       /* Validate objects during execution   */

/* Values used for option[n].val when option[n].type is SQL_EXPLAIN_OPT       */
#define SQL_EXPLAIN_NO         0       /* No Explain output saved             */
#define SQL_EXPLAIN_YES        1       /* Explain output saved                */
#define SQL_EXPLAIN_ALL        2       /* Explain output saved for all        */
                                       /* static and dynamic statements       */

/* Values used for option[n].val when option[n].type is SQL_ACTION_OPT        */
#define SQL_ACTION_ADD         0       /* Package is to be added              */
#define SQL_ACTION_REPLACE     1       /* Package is to be replaced           */

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* REPLVER_OPT                                                                */
#define SQL_MAX_REPLVER        254

/* Values used for option[n].val when option[n].type is SQL_SQLERROR_OPT      */
#define SQL_SQLERROR_NOPACKAGE SQL_NO_SYNTAX_CHECK /* Do not create a         */
                                       /* package if errors are encountered   */
#define SQL_SQLERROR_CHECK     SQL_SYNTAX_CHECK /* Do not create a package    */
#define SQL_SQLERROR_CONTINUE  2       /* Create a package even if errors     */
                                       /* are encountered                     */

/* Values used for option[n].val when option[n].type is SQL_RETAIN_OPT        */
#define SQL_RETAIN_NO          0       /* Do not preserve EXECUTE             */
                                       /* authorities when a package is       */
                                       /* replaced                            */
#define SQL_RETAIN_YES         1       /* Preserve EXECUTE authorities when   */
                                       /* a package is replaced               */

/* Values used for option[n].val when option[n].type is SQL_RELEASE_OPT       */
#define SQL_RELEASE_COMMIT     0       /* Release resources at COMMIT         */
#define SQL_RELEASE_DEALLOCATE 1       /* Release resources when the program  */
                                       /* terminates                          */

/* Values used for option[n].val when option[n].type is SQL_STRDEL_OPT        */
#define SQL_STRDEL_APOSTROPHE  0       /* Apostrophe string delimiter         */
#define SQL_STRDEL_QUOTE       1       /* Quote string delimiter              */

/* Values used for option[n].val when option[n].type is SQL_DECDEL_OPT        */
#define SQL_DECDEL_PERIOD      0       /* Period is used as a decimal point   */
                                       /* indicator in decimal and floating   */
                                       /* point literals                      */
#define SQL_DECDEL_COMMA       1       /* Comma is used as a decimal point    */
                                       /* indicator in decimal and floating   */
                                       /* point literals                      */

/* Values used for option[n].val when option[n].type is SQL_CHARSUB_OPT       */
#define SQL_CHARSUB_DEFAULT    0       /* Use the target system defined       */
                                       /* default for all new character       */
                                       /* columns for which an explicit       */
                                       /* subtype is not specified            */
#define SQL_CHARSUB_BIT        1       /* Use the BIT character subtype for   */
                                       /* all new character columns for       */
                                       /* which an explicit subtype is not    */
                                       /* specified                           */
#define SQL_CHARSUB_SBCS       2       /* Use the SBCS character subtype for  */
                                       /* all new character columns for       */
                                       /* which an explicit subtype is not    */
                                       /* specified                           */
#define SQL_CHARSUB_MIXED      3       /* Use the mixed character subtype     */
                                       /* for all new character columns for   */
                                       /* which an explicit subtype is not    */
                                       /* specified                           */

/* Values used for option[n].val when option[n].type is SQL_DEC_OPT           */
#define SQL_DEC_15             15      /* 15 bit precision is used in         */
                                       /* decimal arithmetic operations       */
#define SQL_DEC_31             31      /* 31 bit precision is used in         */
                                       /* decimal arithmetic operations       */

/* Values used for option[n].val when option[n].type is SQL_DEGREE_OPT        */
#define SQL_DEGREE_1           1       /* Prohibits parallel I/O operations   */
#define SQL_DEGREE_ANY         0       /* Allows the target database system   */
                                       /* to determine the degree of          */
                                       /* parallel I/O operations             */
#define SQL_MAX_DEGREE_VAL     32767   /* Maximum value                       */

/* The next four option values (for CONNECT type, SQLRULES, DISCONNECT and    */
/* SYNCPOINT) are used not only by the precompiler but also by the sqlesetc   */
/* and sqleqryc APIs.                                                         */

/* Values used for option[n].val when option[n].type is SQL_CONNECT_OPT       */
#define SQL_CONNECT_1          1       /* Indicates that only one connection  */
                                       /* to a database can exist at any      */
                                       /* given time.                         */
#define SQL_CONNECT_2          2       /* Indicates that multiple             */
                                       /* connections can exist               */
                                       /* simultaneously, with one being      */
                                       /* active and the others dormant.      */

/* Values used for option[n].val when option[n].type is SQL_RULES_OPT         */
#define SQL_RULES_DB2          1       /* Indicates that CONNECT TO can be    */
                                       /* used to make a dormant connection   */
                                       /* the current connection.             */
#define SQL_RULES_STD          2       /* Indicates that CONNECT TO is not    */
                                       /* valid for making a dormant          */
                                       /* connection current, and SET         */
                                       /* CONNECTION must be used instead.    */

/* Values used for option[n].val when option[n].type is SQL_DISCONNECT_OPT    */
#define SQL_DISCONNECT_EXPL    1       /* Indicates that all connections      */
                                       /* marked by the RELEASE statement     */
                                       /* will be the only connections        */
                                       /* released when a COMMIT is issued.   */
#define SQL_DISCONNECT_COND    2       /* Indicates that all connections      */
                                       /* that do not have open WITH HOLD     */
                                       /* cursors will be the only            */
                                       /* connections released when a COMMIT  */
                                       /* is issued.                          */
#define SQL_DISCONNECT_AUTO    3       /* Indicates that all connections      */
                                       /* will be released when a COMMIT is   */
                                       /* issued.                             */

/* Values used for option[n].val when option[n].type is SQL_SYNCPOINT_OPT     */
#define SQL_SYNC_ONEPHASE      1       /* Do not use a transaction manager    */
                                       /* to perform two phase commit, but    */
                                       /* enforce that there is only one      */
                                       /* database is updated when multiple   */
                                       /* databases are accessed within a     */
                                       /* single transaction.                 */
#define SQL_SYNC_TWOPHASE      2       /* Use a transaction manager to        */
                                       /* coordinate two phase commit.        */
#define SQL_SYNC_NONE          0       /* No update enforcement or two phase  */
                                       /* commit protocol will be used.       */

/* Values used for option[n].val when option[n].type is SQL_DYNAMICRULES_OPT  */
#define SQL_DYNAMICRULES_RUN   0       /* Dynamic SQL in package will use     */
                                       /* authid of person running the        */
                                       /* package                             */
#define SQL_DYNAMICRULES_BIND  1       /* Dynamic SQL in package will use     */
                                       /* authid of person who owns the       */
                                       /* package                             */

/* Values used for option[n].val when option[n].type is SQL_INSERT_OPT        */
#define SQL_INSERT_DEF         0       /* Do not buffer VALUE inserts         */
#define SQL_INSERT_BUF         1       /* Buffer VALUE inserts                */

/* Values used for option[n].val when option[n].type is SQL_EXPLSNAP_OPT      */
#define SQL_EXPLSNAP_NO        0       /* No Explain snapshot saved           */
#define SQL_EXPLSNAP_YES       1       /* Explain snapshot saved              */
#define SQL_EXPLSNAP_ALL       2       /* Explain snapshot saved for all      */
                                       /* static and dynamic statements       */

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* FUNCTION_PATH                                                              */
#define SQL_MAX_FUNCPATH       254

/* Values used for option[n].val when option[n].type is SQL_SQLWARN_OPT       */
#define SQL_SQLWARN_NO         0       /* Suppress prepare-time warning       */
                                       /* SQLCODEs                            */
#define SQL_SQLWARN_YES        1       /* Permit prepare-time warning         */
                                       /* SQLCODEs                            */

/* Values used for option[n].val when option[n].type is SQL_QUERYOPT_OPT      */
#define SQL_QUERYOPT_0         0       /* Class 0 query optimization          */
#define SQL_QUERYOPT_1         1       /* Class 1 query optimization          */
#define SQL_QUERYOPT_3         3       /* Class 3 query optimization          */
#define SQL_QUERYOPT_5         5       /* Class 5 query optimization          */
#define SQL_QUERYOPT_9         9       /* Class 9 query optimization          */

/* Maximum sqlchar length for option[n].val when option[n].type is SQL        */
/* TARGET_OPT                                                                 */
#define SQL_MAX_TARGET_LEN     32

/* Binder Interface Parameters/Return Codes                                   */

SQL_API_RC SQL_API_FN                      /* Bind                            */
  sqlabndx (
        _SQLOLDCHAR * pBindFileName,       /* bind file name                  */
        _SQLOLDCHAR * pMsgFileName,        /* message file                    */
        struct sqlopt * pBindOptions,      /* bind options                    */
        struct sqlca * pSqlca);            /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Rebind                          */
  sqlarbnd (
        char * pPackageName,               /* package name                    */
        struct sqlca * pSqlca,             /* SQLCA                           */
        void * pReserved);                 /* reserved                        */

SQL_API_RC SQL_API_FN                      /* Precompile Program              */
  sqlaprep (
        _SQLOLDCHAR * pProgramName,        /* source file name                */
        _SQLOLDCHAR * pMsgFileName,        /* message file name               */
        struct sqlopt * pPrepOptions,      /* precompile options              */
        struct sqlca * pSqlca);            /* SQLCA                           */

/* Generic Interfaces to the Binder and Precompiler                           */

SQL_API_RC SQL_API_FN                      /* Bind                            */
  sqlgbndx (
        unsigned short MsgFileNameLen,     /* message file name length        */
        unsigned short BindFileNameLen,    /* bind file name length           */
        struct sqlca * pSqlca,             /* SQLCA                           */
        struct sqlopt * pBindOptions,      /* binder options                  */
        _SQLOLDCHAR * pMsgFileName,        /* message file                    */
        _SQLOLDCHAR * pBindFileName);      /* bind file name                  */

SQL_API_RC SQL_API_FN                      /* Rebind                          */
  sqlgrbnd (
        unsigned short PackageNameLen,     /* package name length             */
        char * pPackageName,               /* package name                    */
        struct sqlca * pSqlca,             /* SQLCA                           */
        void * pReserved);                 /* reserved                        */

SQL_API_RC SQL_API_FN                      /* Precompile Program              */
  sqlgprep (
        unsigned short MsgFileNameLen,     /* message file name length        */
        unsigned short ProgramNameLen,     /* source file name length         */
        struct sqlca * pSqlca,             /* SQLCA                           */
        struct sqlopt * pPrepOptions,      /* precompile options              */
        _SQLOLDCHAR * pMsgFileName,        /* message file name               */
        _SQLOLDCHAR * pProgramName);       /* source file name                */

/* Application Context apis                                                   */


#define SQL_CTX_ORIGINAL 0                 /* serial access                   */
#define SQL_CTX_MULTI_MANUAL 1             /* concurrent access               */
SQL_API_RC SQL_API_FN                      /* Set Application Context         */
  sqleSetTypeCtx (
        long);                             /* options                         */


#define SQL_CTX_BEGIN_ALL 0                /* create & attach                 */
#define SQL_CTX_CREATE_ONLY 1              /* create only                     */
SQL_API_RC SQL_API_FN                      /* Create Application Context      */
  sqleBeginCtx (
        void **,                           /* pointer to ctx                  */
        long,                              /* lOptions                        */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


#define SQL_CTX_END_ALL 0                  /* detach & free                   */
#define SQL_CTX_FREE_ONLY 1                /* free only                       */
SQL_API_RC SQL_API_FN                      /* Destroy Application Context     */
  sqleEndCtx (
        void **,                           /* pointer to ctx                  */
        long,                              /* lOptions                        */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


SQL_API_RC SQL_API_FN                      /* Attach to Application Context   */
  sqleAttachToCtx (
        void *,                            /* pointer to ctx                  */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


SQL_API_RC SQL_API_FN                      /* Detach Application Context      */
  sqleDetachFromCtx (
        void *,                            /* pointer to ctx                  */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


SQL_API_RC SQL_API_FN                      /* Destroy Application Context     */
  sqleGetCurrentCtx (
        void **,                           /* pointer to ctx                  */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


SQL_API_RC SQL_API_FN                      /* Interrupt Context               */
  sqleInterruptCtx (
        void *,                            /* pointer to ctx                  */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */


/* Error/SQLSTATE Message Retrieval Interface Parameters/Return Codes         */

/* Get Error Message Macro                                                    */
#define  sqlaintp(msgbuf,bufsize,linesize,sqlcaptr) \
sqlaintp_api(msgbuf,bufsize,linesize, \
(char *)"db2sql.mo", sqlcaptr)
SQL_API_RC SQL_API_FN                      /* Get Error Message               */
  sqlaintp_api (
        char * pBuffer,                    /* buffer for message text         */
        short BufferSize,                  /* buffer size                     */
        short LineWidth,                   /* line width                      */
        char * pMsgFileName,               /* message file                    */
        struct sqlca * pSqlca);            /* SQLCA                           */

/* Generic Interface to Error Message Retrieval                               */
SQL_API_RC SQL_API_FN                      /* Get Error Message               */
  sqlgintp (
        short BufferSize,                  /* buffer size                     */
        short LineWidth,                   /* line width                      */
        struct sqlca * pSqlca,             /* SQLCA                           */
        _SQLOLDCHAR * pBuffer);            /* buffer                          */

SQL_API_RC SQL_API_FN                      /* Sqlstate Message Retrieval      */
  sqlogstt (
        char * pBuffer,                    /* buffer for message text         */
        short BufferSize,                  /* buffer size                     */
        short LineWidth,                   /* line width                      */
        char * pSqlstate);                 /* sqlstate                        */

/* Generic Interface to SQLSTATE Message Retrieval                            */
SQL_API_RC SQL_API_FN                      /* Sqlstate Message Retrieval      */
  sqlggstt (
        short BufferSize,                  /* buffer size                     */
        short LineWidth,                   /* line width                      */
        char * pSqlstate,                  /* sqlstate                        */
        char * pBuffer);                   /* buffer                          */

/* Return Codes for sqlaintp/sqlogstt                                         */
#define SQLA_ERR_BADCC         -1      /* insufficient memory for msg file    */
#define SQLA_ERR_NOCOD         -2      /* no error code in SQLCA              */
#define SQLA_ERR_NOMSG         -3      /* message file inaccessible or        */
                                       /* incorrect                           */
#define SQLA_ERR_BADLL         -4      /* specified line length negative      */
#define SQLA_ERR_BADCA         -5      /* invalid sqlca/buffer addr/length    */

/* Administrative/Database Authorizations returned from Get Administrative    */
/* Authorizations function                                                    */
/* Authorizations granted explicitly to user                                  */
#define SQL_SYSADM             0x1     /* SYSADM Authority                    */
#define SQL_DBADM              0x2     /* DBADM Authority                     */
#define SQL_CREATETAB          0x4     /* CREATETAB Privilege                 */
#define SQL_BINDADD            0x8     /* BINDADD Privilege                   */
#define SQL_CONNECT            0x10    /* CONNECT Privilege                   */
#define SQL_CREATE_NOT_FENC    0x20    /* CREATE_NOT_FENCED Privilege         */
#define SQL_SYSCTRL            0x40    /* SYSCTRL Authority                   */
#define SQL_SYSMAINT           0x80    /* SYSMAINT Authority                  */

/* Composite of authorizations granted explicitly to user, to groups of       */
/* which user is a member, and to PUBLIC                                      */
#define SQL_SYSADM_GRP         (SQL_SYSADM << 8)
#define SQL_DBADM_GRP          (SQL_DBADM << 8)
#define SQL_CREATETAB_GRP      (SQL_CREATETAB << 8)
#define SQL_BINDADD_GRP        (SQL_BINDADD << 8)
#define SQL_CONNECT_GRP        (SQL_CONNECT << 8)
#define SQL_CREATE_NOT_FENC_GRP (SQL_CREATE_NOT_FENC << 8)
#define SQL_SYSCTRL_GRP        (SQL_SYSCTRL << 8)
#define SQL_SYSMAINT_GRP       (SQL_SYSMAINT << 8)

/* Table/View Authorizations/Dependencies Bit definitions in                  */
/* SYSTABAUTH.TABAUTH and SYSPLANDEP.TABAUTH                                  */
#define SQL_TAB_CTL            0x1     /* Control Authority                   */
#define SQL_TAB_ALT            0x2     /* Alter Privilege                     */
#define SQL_TAB_DEL            0x4     /* Delete Privilege/Dependency         */
#define SQL_TAB_IDX            0x8     /* Index Privilege                     */
#define SQL_TAB_INS            0x10    /* Insert Privilege/Dependency         */
#define SQL_TAB_SEL            0x20    /* Select Privilege/Dependency         */
#define SQL_TAB_UPD            0x40    /* Update Privilege/Dependency         */
#define SQL_TAB_REF            0x80    /* Reference Privilege                 */
#define SQL_TAB_KEY            0x2000  /* Key Dependency                      */
#define SQL_TAB_CAS            0x4000  /* Cascade Dependency                  */

/* Definitions for application remote interface                               */
#define SQLZ_DISCONNECT_PROC   1       /* Unload Progam                       */
#define SQLZ_HOLD_PROC         2       /* Keep program loaded                 */
/******************************************************************************
** 
** The following functions and symbols are obsolete and may not be
** supported in future releases. The obsolete functions are provided
** for backward compatibility and exported from DB2API.LIB. All 
** applications should be migrated to use new APIs.
*******************************************************************************/
#define SQLA_RC_BAD_PASSWD     -4      /* Invalid password                    */
#define SQL_MAXSTMTS           32767   /* Maximum statements (see SQL         */
                                       /* reference)                          */
#define SQL_MAXVARS            32767   /* Maximum host variables per          */
                                       /* precompile unit (see SQL            */
                                       /* reference)                          */
#pragma options align=reset

#ifdef __cplusplus 
}
#endif

#endif /* SQL_H_SQL */
mory kzb $ $        * ˸5˸5͸5           *     ./usr/lpp/db2_02_01/include/sqlaprep.h .                    $          /******************************************************************************
** 
** Source File Name: SQLAPREP
** 
** (C) COPYRIGHT International Business Machines Corp. 1988, 1995
** All Rights Reserved
** Licensed Materials - Property of IBM
** 
** US Government Users Restricted Rights - Use, duplication or
** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
** 
** Function = Include File defining:
**              Global equates, structures, and prototypes for
**              Precompiler and Runtime Command Interfaces
** 
** Operating System = AIX
** 
*******************************************************************************/
#ifndef SQL_H_SQLAPREP
#define SQL_H_SQLAPREP

#ifdef __cplusplus
extern "C" {
#endif


/* Required Include Files                                                     */
#include "sqlsystm.h"              /* System dependent defines  */
#include "sqlca.h"
#include "sqlenv.h"
#include "sqladef.h"

#pragma options align=power

/* Macro used to calculate size of a precompiler option array, an input       */
/* parameter of SQLAINIT.                                                     */
#define SQLA_NUM_OPTIONS(n) (sizeof(struct sqla_options_header) + \
(n)*sizeof(struct sqla_option)        )

/* Values used for option[n].type, an input parameter of SQLAINIT.            */
#define SQLA_FORMAT            SQL_FRMT_OPT      /* Option: date/time format  */
#define SQLA_ACCESS_PLAN       2                 /* Option: access plan       */
                                                 /* creation                  */
#define SQLA_BIND_FILE         3                 /* Option: bind file         */
                                                 /* creation                  */
#define SQLA_ISOLATION         SQL_ISO_OPT       /* Option: isolation level   */
#define SQLA_BLOCK             SQL_BLOCK_OPT     /* Option: record blocking   */
#define SQLA_FLAG_OPT          SQL_FLAG_OPT      /* Flagger option            */
#define SQLA_STDS_LEVEL        7                 /* Option: standards         */
                                                 /* compliance                */
#define SQLA_CNULREQD_OPT      SQL_CNULREQD_OPT  /* C NULL required option    */
#define SQLA_LEVEL_OPT         SQL_LEVEL_OPT     /* Level of a module         */
#define SQLA_COLLECTION_OPT    SQL_COLLECTION_OPT /* Package collection id    */
#define SQLA_VERSION_OPT       SQL_VERSION_OPT   /* Package version id        */
#define SQLA_OWNER_OPT         SQL_OWNER_OPT     /* Package owner auth id     */
#define SQLA_SCHEMA_OPT        SQL_SCHEMA_OPT    /* Synonym for owner         */
#define SQLA_QUALIFIER_OPT     SQL_QUALIFIER_OPT /* Authorization identifier  */
                                                 /* that is to be used as     */
                                                 /* qualifier for             */
                                                 /* unqualified objects       */
#define SQLA_CATALOG_OPT       SQL_CATALOG_OPT   /* Synonym for qualifier.    */
#define SQLA_TEXT_OPT          SQL_TEXT_OPT      /* Package description       */
#define SQLA_VALIDATE_OPT      SQL_VALIDATE_OPT  /* Indicates when object     */
                                                 /* validation occurs         */
#define SQLA_EXPLAIN_OPT       SQL_EXPLAIN_OPT   /* Determines whether        */
                                                 /* information will be       */
                                                 /* produced about how the    */
                                                 /* SQL statements in a       */
                                                 /* package will be executed  */
#define SQLA_ACTION_OPT        SQL_ACTION_OPT    /* Indicates whether a       */
                                                 /* package is to be added    */
                                                 /* or replaced               */
#define SQLA_SQLERROR_OPT      SQL_SYNTAX_OPT    /* Indicates under what      */
                                                 /* conditions a package      */
                                                 /* will be created           */
#define SQLA_REPLVER_OPT       SQL_REPLVER_OPT   /* Replaces a specific       */
                                                 /* version of a package      */
#define SQLA_RETAIN_OPT        SQL_RETAIN_OPT    /* Indicates whether         */
                                                 /* EXECUTE authorities are   */
                                                 /* to be preserved when a    */
                                                 /* package is replaced       */
#define SQLA_RELEASE_OPT       SQL_RELEASE_OPT   /* Indicates whether         */
                                                 /* resources are released    */
                                                 /* at each COMMIT or when    */
                                                 /* the application           */
                                                 /* terminates                */
#define SQLA_DEGREE_OPT        SQL_DEGREE_OPT    /* Specifies whether or not  */
                                                 /* the query is executed     */
                                                 /* using I/O parallelism     */
#define SQLA_STRDEL_OPT        SQL_STRDEL_OPT    /* Designates whether an     */
                                                 /* apostrophe or quote will  */
                                                 /* be used as a string       */
                                                 /* delimiter                 */
#define SQLA_DECDEL_OPT        SQL_DECDEL_OPT    /* Designates whether a      */
                                                 /* period or comma will be   */
                                                 /* used as a decimal point   */
                                                 /* indicator                 */
#define SQLA_CHARSUB_OPT       SQL_CHARSUB_OPT   /* Designates default        */
                                                 /* character subtype that    */
                                                 /* is to be used for column  */
                                                 /* definitions in the        */
                                                 /* CREATE and ALTER TABLE    */
                                                 /* SQL statements            */
#define SQLA_CCSIDS_OPT        SQL_CCSIDS_OPT    /* Designates what CCSID     */
                                                 /* will be used for single   */
                                                 /* byte characters for       */
                                                 /* character column          */
                                                 /* definitions without a     */
                                                 /* specific CCSID clause in  */
                                                 /* the CREATE and ALTER      */
                                                 /* TABLE SQL statements      */
#define SQLA_CCSIDM_OPT        SQL_CCSIDM_OPT    /* Designates what CCSID     */
                                                 /* will be used for mixed    */
                                                 /* byte characters for       */
                                                 /* character column          */
                                                 /* definitions without a     */
                                                 /* specific CCSID clause in  */
                                                 /* the CREATE and ALTER      */
                                                 /* TABLE SQL statements      */
#define SQLA_CCSIDG_OPT        SQL_CCSIDG_OPT    /* Designates what CCSID     */
                                                 /* will be used for double   */
                                                 /* byte characters for       */
                                                 /* character column          */
                                                 /* definitions without a     */
                                                 /* specific CCSID clause in  */
                                                 /* the CREATE and ALTER      */
                                                 /* TABLE SQL statements      */
#define SQLA_DEC_OPT           SQL_DEC_OPT       /* Specifies the maximum     */
                                                 /* precision to be used in   */
                                                 /* decimal arithmetic        */
                                                 /* operations                */
#define SQLA_CONNECT_OPT       SQL_CONNECT_OPT   /* Specifies whether one or  */
                                                 /* multiple connections can  */
                                                 /* exist at the same time.   */
#define SQLA_SQLRULES_OPT      SQL_RULES_OPT     /* Specifies the set of      */
                                                 /* rules used for            */
                                                 /* connection to multiple    */
                                                 /* databases within a        */
                                                 /* single unit of work       */
#define SQLA_DISCONNECT_OPT    SQL_DISCONNECT_OPT /* Specifies which          */
                                                 /* databases disconnected    */
                                                 /* when a COMMIT or          */
                                                 /* ROLLBACK is issued.       */
#define SQLA_SYNCPOINT_OPT     SQL_SYNCPOINT_OPT /* Specifies what syncpoint  */
                                                 /* option (for example one   */
                                                 /* or two phase) will be     */
                                                 /* used.                     */
#define SQLA_DYNAMICRULES_OPT  SQL_DYNAMICRULES_OPT /* Specifies which        */
                                                 /* authorization identifier  */
                                                 /* to use when dynamic SQL   */
                                                 /* in a package is           */
                                                 /* executed. Owner of        */
                                                 /* package or authid         */
                                                 /* executing package.        */
#define SQLA_INSERT            SQL_INSERT_OPT    /* Buffers VALUE inserts -   */
                                                 /* bind and precompile       */
                                                 /* option for DB2/PE         */
                                                 /* servers only              */
#define SQLA_EXPLSNAP_OPT      SQL_EXPLSNAP_OPT  /* Capture explain snapshot  */
                                                 /* - bind and precompile     */
                                                 /* option                    */
#define SQLA_FUNCTION_PATH     SQL_FUNCTION_PATH /* Path for user-defined     */
                                                 /* function resolution -     */
                                                 /* bind and precompile       */
                                                 /* option                    */
#define SQLA_SQLWARN_OPT       SQL_SQLWARN_OPT   /* Disable prepare-time SQL  */
                                                 /* warnings - bind and       */
                                                 /* precompile option         */
#define SQLA_QUERYOPT_OPT      SQL_QUERYOPT_OPT  /* Set query optimization    */
                                                 /* class -bind and           */
                                                 /* precompile option         */
#define SQLA_TARGET_OPT        SQL_TARGET_OPT    /* Target compiler           */
                                                 /* precompile option         */
#define SQLA_PREP_OUTPUT_OPT   SQL_PREP_OUTPUT_OPT /* Name of precompiler     */
                                                 /* output file - precompile  */
                                                 /* option                    */
#define SQLA_TOKEN_USE_INITIALIZED_OPT 1000      /* Internal use only         */

/* Values used for option[n].val when option[n].type is SQLA_FORMAT in        */
/* the Precompiler Option Array.                                              */
#define SQLA_POA_DEF           0       /* Default date/time format            */
#define SQLA_POA_USA           1       /* USA date/time format                */
#define SQLA_POA_EUR           2       /* European date/time format           */
#define SQLA_POA_ISO           3       /* International date/time format      */
#define SQLA_POA_JIS           4       /* Japanese date/time format           */
#define SQLA_POA_LOC           5       /* Local date/time format              */

/* Values used for option[n].val when option[n].type is SQLA_ACCESS_PLAN in   */
/* the Precompiler Option Array.                                              */
#define SQLA_CREATE_PLAN       1       /* Create an access plan               */
#define SQLA_NO_PLAN           0       /* Do not create an access plan        */
#define SQLA_NO_PLAN_SYNTAX    3       /* Set ocb->syntax to TRUE             */

/* Values used for option[n].val when option[n].type is SQLA_BIND_FILE in     */
/* the Precompiler Option Array.                                              */
#define SQLA_CREATE_BIND_FILE  1       /* Create a bind file                  */
#define SQLA_NO_BIND_FILE      0       /* Do not create a bind file           */

/* Values used for option[n].val when option[n].type is SQLA_ISOLATION in     */
/* the Precompiler Option Array.                                              */
#define SQLA_REPEATABLE_READ   SQL_REP_READ      /* RR isolation level        */
#define SQLA_CURSOR_STABILITY  SQL_CURSOR_STAB   /* CS Isolation level        */
#define SQLA_UNCOMMITTED_READ  SQL_UNCOM_READ    /* UR Isolation level        */
#define SQLA_READ_STABILITY    SQL_READ_STAB     /* RS Isolation level        */
#define SQLA_NO_COMMIT         SQL_NO_COMMIT     /* NC Isolation level        */

/* Values used for option[n].val when option[n].type is SQLA_BLOCK in         */
/* the Precompiler Option Array.                                              */
#define SQLA_BLOCK_UNAMBIG     SQL_BL_UNAMBIG
#define SQLA_BLOCK_ALL         SQL_BL_ALL
#define SQLA_NO_BLOCK          SQL_NO_BL

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* LEVEL_OPT                                                                  */
#define SQLA_MAX_LEVEL         SQL_MAX_LEVEL

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* COLLECTION_OPT                                                             */
#define SQLA_MAX_COLLECTION    SQL_MAX_COLLECTION

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* VERSION_OPT                                                                */
#define SQLA_MAX_VERSION       SQL_MAX_VERSION

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* OWNER_OPT                                                                  */
#define SQLA_MAX_OWNER         SQL_MAX_OWNER

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* SCHEMA_OPT                                                                 */
#define SQLA_MAX_SCHEMA        SQLA_MAX_OWNER

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* QUALIFIER_OPT                                                              */
#define SQLA_MAX_QUALIFIER     SQL_MAX_QUALIFIER

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* CATALOG_OPT                                                                */
#define SQLA_MAX_CATALOG       SQLA_MAX_QUALIFIER

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA_TEXT  */
/* OPT                                                                        */
#define SQLA_MAX_TEXT          SQL_MAX_TEXT

/* Values used for option[n].val when option[n].type is SQLA_VALIDATE_OPT.    */
#define SQLA_VALIDATE_BIND     SQL_VALIDATE_BIND /* Validate objects during   */
                                                 /* BIND                      */
#define SQLA_VALIDATE_RUN      SQL_VALIDATE_RUN  /* Validate objects during   */
                                                 /* execution                 */

/* Values used for option[n].val when option[n].type is SQLA_EXPLAIN_OPT.     */
#define SQLA_EXPLAIN_NO        SQL_EXPLAIN_NO    /* No EXPLAIN output         */
                                                 /* produced                  */
#define SQLA_EXPLAIN_YES       SQL_EXPLAIN_YES   /* EXPLAIN output produced   */
#define SQLA_EXPLAIN_ALL       SQL_EXPLAIN_ALL   /* EXPLAIN output produced   */
                                                 /* for all static and        */
                                                 /* dynamic statements.       */

/* Values used for option[n].val when option[n].type is SQLA_ACTION_OPT.      */
#define SQLA_ACTION_ADD        SQL_ACTION_ADD    /* Package is added          */
#define SQLA_ACTION_REPLACE    SQL_ACTION_REPLACE /* Package is replaced      */

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* REPLVER_OPT                                                                */
#define SQLA_MAX_REPLVER       SQL_MAX_REPLVER

/* Values used for option[n].val when option[n].type is SQLA_SQLERROR_OPT.    */
#define SQLA_SQLERROR_NOPACKAGE SQL_NO_SYNTAX_CHECK /* Do not create a        */
                                                 /* package if errors are     */
                                                 /* encountered               */
#define SQLA_SQLERROR_CHECK    SQL_SYNTAX_CHECK  /* Do not create a package   */
#define SQLA_SQLERROR_CONTINUE SQL_SQLERROR_CONTINUE /* Create a package      */
                                                 /* even if errors are        */
                                                 /* encountered               */

/* Values used for option[n].val when option[n].type is SQLA_RETAIN_OPT.      */
#define SQLA_RETAIN_NO         SQL_RETAIN_NO     /* Do not preserve EXECUTE   */
                                                 /* authorities when a        */
                                                 /* package is replaced       */
#define SQLA_RETAIN_YES        SQL_RETAIN_YES    /* Preserve EXECUTE          */
                                                 /* authorities when a        */
                                                 /* package is replaced       */

/* Values used for option[n].val when option[n].type is SQLA_RELEASE_OPT.     */
#define SQLA_RELEASE_COMMIT    SQL_RELEASE_COMMIT /* Release resources at     */
                                                 /* COMMIT                    */
#define SQLA_RELEASE_DEALLOCATE SQL_RELEASE_DEALLOCATE /* Release resources   */
                                                 /* when a program            */
                                                 /* terminates                */

/* Values used for option[n].val when option[n].type is SQLA_STRDEL_OPT.      */
#define SQLA_STRDEL_APOSTROPHE SQL_STRDEL_APOSTROPHE /* Apostrophe string     */
                                                 /* delimiter                 */
#define SQLA_STRDEL_QUOTE      SQL_STRDEL_QUOTE  /* Quote string delimiter    */

/* Values used for option[n].val when option[n].type is SQLA_DECDEL_OPT.      */
#define SQLA_DECDEL_PERIOD     SQL_DECDEL_PERIOD /* Period is used as a       */
                                                 /* decimal point indicator   */
                                                 /* in decimal and floating   */
                                                 /* point literals            */
#define SQLA_DECDEL_COMMA      SQL_DECDEL_COMMA  /* Comma is used as a        */
                                                 /* decimal point indicator   */
                                                 /* in decimal and floating   */
                                                 /* point literals            */

/* Values used for option[n].val when option[n].type is SQLA_CHARSUB_OPT.     */
#define SQLA_CHARSUB_DEFAULT   SQL_CHARSUB_DEFAULT /* Use the target system   */
                                                 /* defined default for all   */
                                                 /* new character columns     */
                                                 /* for which an explicit     */
                                                 /* subtype is not specified  */
#define SQLA_CHARSUB_BIT       SQL_CHARSUB_BIT   /* Use the bit character     */
                                                 /* subtype for all new       */
                                                 /* character columns for     */
                                                 /* which an explicit         */
                                                 /* subtype is not specified  */
#define SQLA_CHARSUB_SBCS      SQL_CHARSUB_SBCS  /* Use the SBCS character    */
                                                 /* subtype for all new       */
                                                 /* character columns for     */
                                                 /* which an explicit         */
                                                 /* subtype is not specified  */
#define SQLA_CHARSUB_MIXED     SQL_CHARSUB_MIXED /* Use the mixed character   */
                                                 /* subtype for all new       */
                                                 /* character columns for     */
                                                 /* which an explicit         */
                                                 /* subtype is not specified  */

/* Values used for option[n].val when option[n].type is SQLA_DEC_OPT.         */
#define SQLA_DEC_15            SQL_DEC_15        /* 15 bit precision is used  */
                                                 /* in decimal arithmetic     */
                                                 /* operations                */
#define SQLA_DEC_31            SQL_DEC_31        /* 31 bit precision is used  */
                                                 /* in decimal arithmetic     */
                                                 /* operations                */

/* Values used for option[n].val when option[n].type is SQLA_DEGREE_OPT.      */
#define SQLA_DEGREE_1          SQL_DEGREE_1      /* Prohibits parallel I/O    */
                                                 /* operations                */
#define SQLA_DEGREE_ANY        SQL_DEGREE_ANY    /* Allows the target         */
                                                 /* database system to        */
                                                 /* determine the degree of   */
                                                 /* parallel I/O operations   */
#define SQLA_MAX_DEGREE_VAL    SQL_MAX_DEGREE_VAL /* Maximum value            */

/* Values used for option[n].val when option[n].type is SQLA_CNULREQD_OPT in  */
/* the Precompiler Option array                                               */
#define SQLA_CNULREQD_NO       SQL_CNULREQD_NO   /* C NULL is not required    */
#define SQLA_CNULREQD_YES      SQL_CNULREQD_YES  /* C NULL is not required    */

/* Values used for option[n].val when option[n].type is SQLA_CONNECT_OPT.     */
#define SQLA_CONNECT_1         SQL_CONNECT_1     /* Indicates that only one   */
                                                 /* connection to a database  */
                                                 /* can exist at any given    */
                                                 /* time.                     */
#define SQLA_CONNECT_2         SQL_CONNECT_2     /* Indicates that multiple   */
                                                 /* connections can exist     */
                                                 /* simultaneously, with one  */
                                                 /* being active and the      */
                                                 /* others dormant.           */

/* Values used for option[n].val when option[n].type is SQLA_RULES_OPT.       */
#define SQLA_RULES_DB2         SQL_RULES_DB2     /* Indicates that CONNECT    */
                                                 /* TO can be used to make a  */
                                                 /* dormant connection the    */
                                                 /* current connection.       */
#define SQLA_RULES_STD         SQL_RULES_STD     /* Indicates that CONNECT    */
                                                 /* TO is not valid for       */
                                                 /* making a dormant          */
                                                 /* connection current,and    */
                                                 /* SET CONNECTION must be    */
                                                 /* used instead.             */
/* Values used for option[n].val when option[n].type is SQLA_DISCONNECT_OPT.  */
#define SQLA_DISCONNECT_EXPL   SQL_DISCONNECT_EXPL /* Indicates that all      */
                                                 /* connections marked by     */
                                                 /* the RELEASE statement     */
                                                 /* will be the only          */
                                                 /* connections released      */
                                                 /* when a COMMIT or          */
                                                 /* ROLLBACK is issued.       */
#define SQLA_DISCONNECT_COND   SQL_DISCONNECT_COND /* Indicates that all      */
                                                 /* connections which don't   */
                                                 /* have open WITH HOLD       */
                                                 /* cursors will be the only  */
                                                 /* connections released      */
                                                 /* when a COMMIT or          */
                                                 /* ROLLBACK is issued.       */
#define SQLA_DISCONNECT_AUTO   SQL_DISCONNECT_AUTO /* Indicates that all      */
                                                 /* connections will be       */
                                                 /* released when a COMMIT    */
                                                 /* or ROLLBACK is issued.    */

/* Values used for option[n].val when option[n].type is SQLA_SYNCPOINT_OPT.   */
#define SQLA_SYNC_ONEPHASE     SQL_SYNC_ONEPHASE /* Do not use a transaction  */
                                                 /* manager to perform two    */
                                                 /* phase commit,but enforce  */
                                                 /* that there is only one    */
                                                 /* database is updated when  */
                                                 /* multiple databases are    */
                                                 /* accessed within a single  */
                                                 /* transaction.              */
#define SQLA_SYNC_TWOPHASE     SQL_SYNC_TWOPHASE /* Use a transaction         */
                                                 /* manager to coordinate     */
                                                 /* two phase commit.         */
#define SQLA_SYNC_NONE         SQL_SYNC_NONE     /* No two-phase commit and   */
                                                 /* no single updater         */
                                                 /* enforcement.              */

/* Values used for option[n].val when option[n].type is SQLA_DYNAMICRULES     */
/* OPT.                                                                       */
#define SQLA_DYNAMICRULES_RUN  SQL_DYNAMICRULES_RUN /* Dynamic SQL in         */
                                                 /* package will use authid   */
                                                 /* of person running the     */
                                                 /* package                   */
#define SQLA_DYNAMICRULES_BIND SQL_DYNAMICRULES_BIND /* Dynamic SQL in        */
                                                 /* package will use authid   */
                                                 /* of person who owns the    */
                                                 /* package                   */

/* Values used for option[n].val when option[n].type is SQLA_FLAG_OPT inthe   */
/* Precompiler Option Array.                                                  */
#define SQLA_DB2V23_SYNTAX     SQL_MVSDB2V23_SYNTAX
#define SQLA_DB2V31_SYNTAX     SQL_MVSDB2V31_SYNTAX
#define SQLA_DB2V41_SYNTAX     SQL_MVSDB2V41_SYNTAX

/* Values used for option[n].val when option[n].type is SQLA_EXPLSNAP_OPT in  */
/* the Precompiler Option array                                               */
#define SQLA_EXPLSNAP_NO       SQL_EXPLSNAP_NO   /* Do not save explain       */
                                                 /* snapshot                  */
#define SQLA_EXPLSNAP_YES      SQL_EXPLSNAP_YES  /* Save explain snapshot     */
#define SQLA_EXPLSNAP_ALL      SQL_EXPLSNAP_ALL  /* Save explain snapshot     */
                                                 /* for all static and        */
                                                 /* dynamic statements        */

/* Maximum sqlchar length for option[n].val when option[n].type is SQLA       */
/* FUNCTION_PATH                                                              */
#define SQLA_MAX_FUNCPATH      SQL_MAX_FUNCPATH

/* Values used for option[n].val when option[n].type is SQLA_SQLWARN_OPT in   */
/* the Precompiler Option array                                               */
#define SQLA_SQLWARN_NO        SQL_SQLWARN_NO    /* Suppress prepare-time     */
                                                 /* warning SQLCODEs          */
#define SQLA_SQLWARN_YES       SQL_SQLWARN_YES   /* Permit prepare-time       */
                                                 /* warning SQLCODEs          */

/* Values used for option[n].val when option[n].type is SQLA_QUERYOPT_OPT in  */
/* the Precompiler Option array                                               */
#define SQLA_QUERYOPT_0        SQL_QUERYOPT_0    /* Class 0 query             */
                                                 /* optimization              */
#define SQLA_QUERYOPT_1        SQL_QUERYOPT_1    /* Class 1 query             */
                                                 /* optimization              */
#define SQLA_QUERYOPT_3        SQL_QUERYOPT_3    /* Class 3 query             */
                                                 /* optimization              */
#define SQLA_QUERYOPT_5        SQL_QUERYOPT_5    /* Class 5 query             */
                                                 /* optimization              */
#define SQLA_QUERYOPT_9        SQL_QUERYOPT_9    /* Class 9 query             */
                                                 /* optimization              */

/* Values used for option[n].val when option[n].type is SQLA_INSERT_OPT       */
#define SQLA_INSERT_DEF        SQL_INSERT_DEF    /* Do not buffer VALUE       */
                                                 /* inserts                   */
#define SQLA_INSERT_BUF        SQL_INSERT_BUF    /* Buffer VALUE inserts      */

/* Maximum target string length in option[n].val when option[n].type is SQLA  */
/* TARGET_OPT                                                                 */
#define SQLA_MAX_TARGET_LEN    SQL_MAX_TARGET_LEN

/* Values used for option[n].val when option[n].type is SQLA_STDS_LEVEL       */
/* inthe Precompiler Option Array.                                            */
#define SQLA_STND_NONE         0                 /* No compliance required    */
#define SQLA_STND_MIA          1                 /* Comply with MIA standard  */

/* Values used for location, an input parameter of SQLAAHVR.                  */
#define SQLA_DECLARE_SECT      0       /* Add host var found in a declare     */
                                       /* section                             */
#define SQLA_SQL_STMT          1       /* Add host var found in an SQL        */
                                       /* statement                           */

/* Values assigned to task[n].func, an output parameter of SQLACMPL.          */
#define SQLA_START             0       /* Generate a call to sqlastrt         */
#define SQLA_DECLARE           1       /* Begin or end parsing hvar           */
                                       /* declarations                        */
#define SQLA_INCLUDE           2       /* Generate code for an SQLCA or       */
                                       /* SQLDA                               */
#define SQLA_ALLOC_INPUT       3       /* Allocate an input SQLDA using       */
                                       /* SQLAALOC                            */
#define SQLA_ALLOC_OUTPUT      4       /* Allocate an output SQLDA using      */
                                       /* SQLAALOC                            */
#define SQLA_SETS              5       /* Register a host variable using      */
                                       /* SQLASETS                            */
#define SQLA_USDA_INPUT        6       /* Register an input user-defined      */
                                       /* SQLDA                               */
#define SQLA_USDA_OUTPUT       7       /* Register an output user-defined     */
                                       /* SQLDA                               */
#define SQLA_CALL              8       /* Generate a call to SQLACALL         */
#define SQLA_DEALLOC           9       /* Generate a call to SQLADLOC         */
#define SQLA_STOP              10      /* Generate a call to SQLASTOP         */
#define SQLA_SQLERROR          11      /* Generate code for WHENEVER          */
                                       /* SQLERROR                            */
#define SQLA_SQLWARNING        12      /* Generate code for WHENEVER          */
                                       /* SQLWARNING                          */
#define SQLA_NOT_FOUND         13      /* Generate code for WHENEVER NOT      */
                                       /* FOUND                               */
#define SQLA_INC_TEXTFILE      14      /* Process an INCLUDE text-file stmt   */
#define SQLA_BEGIN_COMPOUND    15      /* Begin Compound SQL block            */
#define SQLA_CMPD              16      /* Generate a call to SQLACMPD         */
#define SQLA_CMPD_TEST         17      /* Generate a conditional branch       */
                                       /* around subsequent Compound SQL      */
                                       /* substatements.                      */
#define SQLA_CMPD_MARK         18      /* Generate a target label for gotos   */
                                       /* from cmpd_test (optional)           */
#define SQLA_NEXT_SUBSTATEMENT 19      /* Request the outer precompiler to    */
                                       /* get the next triggered SQL          */
                                       /* statement                           */

/* Values returned in task[n].val when task[n].func is SQLA_DECLARE.          */
/* This is an output parameter of SQLACMPL.                                   */
#define SQLA_BEGIN             0
#define SQLA_END               1

/* Values returned in task[n].val when task[n].func is SQLA_INCLUDE.          */
/* This is an output parameter of SQLACMPL.                                   */
#define SQLA_SQLCA             10
#define SQLA_SQLDA             11

/* Values returned in task[n].val when task[n].func is SQLA_CALL.             */
/* This is an output parameter of SQLACMPL.                                   */
#define SQLA_CLOSE             20
#define SQLA_COMMIT            21
#define SQLA_DESCRIBE          22
#define SQLA_EXECIMMD          23
#define SQLA_EXECUTE           24
#define SQLA_FETCH             25
#define SQLA_OPEN              26
#define SQLA_PREPARE           27
#define SQLA_ROLLBACK          28
#define SQLA_CONNECT           29
#define SQLA_CMPDEXEC          30      /* Atomic Compound SQL call            */
#define SQLA_FREE_LOB_LOCATORS 37      /* SQL free locators call              */
#define SQLA_CMPDEXEC_NA       38      /* Not Atomic Compound SQL call        */
#define SQLA_DUOW              40
#define SQLA_CLOSE_REL         41      /* Close Cursor with Release           */
#define SQLA_CALLPROC          42      /* Stored Procedure SQL call           */
#define SQLA_SET_CURRENT_PKGSET 43     /* Set Current Packageset              */
#define SQLA_EXECIMMD_ASYNC    44
#define SQLA_EXECUTE_ASYNC     45
#define SQLA_FETCH_ASYNC       46
#define SQLA_OPEN_ASYNC        47
#define SQLA_CALLPROC_ASYNC    48
#define SQLA_CMPDEXEC_ASYNC    49
#define SQLA_DESCRIBE_ASYNC    50
#define SQLA_PREPARE_ASYNC     51
#define SQLA_EXECIMMD_ASYNC_COMMIT 52
#define SQLA_EXECUTE_ASYNC_COMMIT 53
#define SQLA_CMPDEXEC_ASYNC_COMMIT 54
#define SQLA_EXECIMMD_COMMIT   55
#define SQLA_EXECUTE_COMMIT    56
#define SQLA_CMPDEXEC_COMMIT   57
#define SQLA_CMPDEXEC_NA_ASYNC 58
#define SQLA_CMPDEXEC_NA_COMMIT 59
#define SQLA_CMPDEXEC_NA_DIAG  60
#define SQLA_CMPDEXEC_NA_ASYNC_COMMIT 61
#define SQLA_CMPDEXEC_NA_ASYNC_DIAG 62
#define SQLA_CMPDEXEC_NA_COMMIT_DIAG 63
#define SQLA_CMPDEXEC_NA_A_C_D 64
#define SQLA_CLOSE_OPEN        65
#define SQLA_CLOSE_OPEN_ASYNC  66
#define SQLA_CLOSEREL_OPEN_ASYNC 67
#define SQLA_CLOSEREL_OPEN     68

/* Values assigned to token[n].use, an output parameter of SQLACMPL.          */
#define SQLA_INPUT_HVAR        0       /* Input host var, no indicator var    */
#define SQLA_INPUT_WITH_IND    1       /* Input host var followed by          */
                                       /* indicator var                       */
#define SQLA_OUTPUT_HVAR       2       /* Output host var, no indicator var   */
#define SQLA_OUTPUT_WITH_IND   3       /* Output host var followed by         */
                                       /* indicator var                       */
#define SQLA_INDICATOR         4       /* Indicator variable                  */
#define SQLA_USER_SQLDA        5       /* SQLDA structure                     */
#define SQLA_INVALID_USE       6       /* Host variable type does not match   */
                                       /* use                                 */
#define SQLA_INVALID_ID        7       /* Host variable token ID is not       */
                                       /* valid                               */
#define SQLA_LITERAL           8       /* Literal string                      */
#define SQLA_MULTIPLE_STRUCT_FIELD 9   /* Host var was one of several fields  */
                                       /* expanded from a structure           */
                                       /* reference                           */
#define SQLA_ATOMIC_FIELD      10      /* Host var was either atomic or a     */
                                       /* single field from a structure       */
                                       /* reference                           */

/* Values assigned to stmt_type, an output parameter of SQLACMPL.             */
#define SQLA_TYPE_NULL_CONNECT                   0
#define SQLA_TYPE_CONN_EXCL_NO_PWD               1
#define SQLA_TYPE_CONN_EXCL_PWD                  2
#define SQLA_TYPE_CONNECT_RESET                  3
#define SQLA_TYPE_CONN_SHARE_NO_PWD              4
#define SQLA_TYPE_CONN_SHARE_PWD                 5
#define SQLA_TYPE_CONNECT_USERID                 6
#define SQLA_TYPE_BEGIN                          10
#define SQLA_TYPE_BEGIN_COMPOUND                 12
#define SQLA_TYPE_CALLPROC                       13
#define SQLA_TYPE_CLOSE                          15
#define SQLA_TYPE_COMMIT                         20
#define SQLA_TYPE_CONNECT_1                      21
#define SQLA_TYPE_CONNECT_2                      22
#define SQLA_TYPE_DISCONNECT_DBNAME              23
#define SQLA_TYPE_DISCONNECT_CURRENT             24
#define SQLA_TYPE_DISCONNECT_ALL                 25
#define SQLA_TYPE_RELEASE_DBNAME                 26
#define SQLA_TYPE_RELEASE_CURRENT                27
#define SQLA_TYPE_RELEASE_ALL                    28
#define SQLA_TYPE_SET_CONNECTION                 29
#define SQLA_TYPE_DECLARE_SELECT                 30
#define SQLA_TYPE_DECLARE_SNAME                  40
#define SQLA_TYPE_DESCRIBE                       50
#define SQLA_TYPE_END                            60
#define SQLA_TYPE_END_COMPOUND                   65
#define SQLA_TYPE_EXECUTE                        70
#define SQLA_TYPE_EXECUTE_IMM                    80
#define SQLA_TYPE_FETCH                          90
#define SQLA_TYPE_FREE_LOB_LOCATOR               95
#define SQLA_TYPE_INCLUDE_SQLCA                  100
#define SQLA_TYPE_INCLUDE_SQLDA                  110
#define SQLA_TYPE_INCLUDE_TEXTFILE               115
#define SQLA_TYPE_OPEN                           120
#define SQLA_TYPE_PREPARE                        130
#define SQLA_TYPE_ROLLBACK                       140
#define SQLA_TYPE_SELECT                         150
#define SQLA_TYPE_SELECT_INTO                    160
#define SQLA_TYPE_SET_CURRENT_PKGSET             163
#define SQLA_TYPE_WHEN_NOT_FOUND                 170
#define SQLA_TYPE_WHEN_SQLERROR                  180
#define SQLA_TYPE_WHEN_SQLWARNING                190
#define SQLA_TYPE_OTHER                          200

/* Values used for term_option, an input parameter of SQLAFINI.               */
#define SQLA_SAVE              1       /* Save the access plan and/or bind    */
                                       /* file                                */
#define SQLA_DISCARD           0       /* Discard the access plan and/or      */
                                       /* bind file                           */

/* Miscellaneous Constants                                                    */

#define SQL_MAX_FILE_NAME_LENGTH 128   /* size of SQLAINIT file name buffer   */

#define SQL_CMPL_BUFSIZ        128     /* size of SQLACMPL output buffers     */
#define SQL_PID_LENGTH         40      /* length of precompiler pid           */
#define SQLA_FLAG_MAXMSGS      10      /* Message array length same as SQLH   */
                                       /* MAXMSGS                             */
#define SQLA_FLAG_VERSION      1       /* Current SQL Flagger version         */

/* Return codes from Precompiler Services and Runtime Services functions.     */
#define SQLA_SQLCA_BAD         -1      /* sqlca pointer/length invalid        */
#define SQLA_CHECK_SQLCA       0       /* check sqlca completion status       */

/* Values returned in sqlca.sqlcode by Precompiler or Runtime Services        */
#define SQLA_RC_OK                     SQL_RC_OK
#define SQLA_RC_OPTION_IGNORED         20
#define SQLA_RC_CHAR_BAD               SQL_RC_E007
#define SQLA_RC_STRING_NOT_TERMINATED  SQL_RC_E010
#define SQLA_RC_EMPTY_DEL_IDENT        SQL_RC_E013
#define SQLA_RC_BFILE_OPEN_ERROR       -31
#define SQLA_RC_BFILE_DISK_ERROR       -32
#define SQLA_RC_SECTION_LIMIT          -51
#define SQLA_RC_MEMORY_BAD             -83
#define SQLA_RC_SNAME_DUP              -85
#define SQLA_RC_NO_STRUCT              -87
#define SQLA_RC_AMBIG_HOSTVAR          -88
#define SQLA_RC_STMT_LIMIT             SQL_RC_E101
#define SQLA_RC_NUMBER_BAD             SQL_RC_E103
#define SQLA_RC_STMT_SYNTAX_BAD        SQL_RC_E104
#define SQLA_RC_GSTRING_BAD            SQL_RC_E105 /* DBCS only               */
#define SQLA_RC_IDENTIFIER_LIMIT       SQL_RC_E107
#define SQLA_RC_QUALIFIER_BAD          SQL_RC_E108
#define SQLA_RC_DDSBAD                 SQL_RC_E142
#define SQLA_RC_DDSIGN                 SQL_RC_W143
#define SQLA_RC_DDSWRN                 SQL_RC_W143
#define SQLA_RC_KEYWORD_BAD            SQL_RC_E199
#define SQLA_RC_HVAR_NOT_DEC           -306
#define SQLA_RC_HVAR_DUP_NAME          -307
#define SQLA_RC_HVAR_LIMIT             -308
#define SQLA_RC_STMT_HVAR_LIMIT        -310
#define SQLA_RC_HVAR_USE_BAD           -324
#define SQLA_RC_CURSOR_DUP             -505
#define SQLA_RC_STMT_MODIFY_ALL        513
#define SQLA_RC_INVALID_TRIGGER_STMT   SQL_RC_E751
#define SQLA_RC_SQLDA_SQLD_ERR         SQL_RC_E804
#define SQLA_RC_SQLVAR_TYPE_ERR        SQL_RC_E804
#define SQLA_RC_DISK_FULL              SQL_RC_E968
#define SQLA_RC_CMPD_NESTED            -4010
#define SQLA_RC_CMPD_INVALID_STMT      -4011
#define SQLA_RC_CMPD_INVALID_COMMIT    -4012
#define SQLA_RC_CMPD_INVALID_END       -4013
#define SQLA_RC_INVALID_CMPD_SYNTAX    -4014
#define SQLA_RC_FATAL_ERROR            -4901
#define SQLA_RC_PARM_CHARS_BAD         -4902
#define SQLA_RC_PARM_LENGTH_BAD        SQLA_RC_OPTION_LEN_BAD
#define SQLA_RC_PARM_POINTER_BAD       SQLA_RC_OPTION_PTR_BAD
#define SQLA_RC_PARM_RANGE_BAD         SQLA_RC_OPTION_SIZE_BAD
#define SQLA_RC_HVAR_SQLTYPE_BAD       -4911
#define SQLA_RC_HVAR_SQLLEN_BAD        -4912
#define SQLA_RC_HVAR_TOKEN_ID_DUP      -4913
#define SQLA_RC_HVAR_TOKEN_ID_BAD      -4914
#define SQLA_RC_INIT_DUP               -4915
#define SQLA_RC_INIT_REQUIRED          -4916
#define SQLA_RC_OPTION_BAD             SQLA_RC_OPTION_DATA_BAD
#define SQLA_RC_TERM_OPTION_BAD        -4918
#define SQLA_RC_TASK_ARRAY_LIMIT       -4919
#define SQLA_RC_TOKEN_ARRAY_LIMIT      -4920
#define SQLA_RC_OPTION_GEN_INVALID     SQLA_RC_OPTION_INVALID
#define SQLA_RC_STMT_CLAUSE_BAD        -4940       /* Prep version of -109    */
#define SQLA_RC_STMT_BLANK             -4941       /* Prep version of -198    */
#define SQLA_RC_SELECT_HVAR_TYPE_BAD   -4942       /* Prep version of -303    */
#define SQLA_RC_SELECT_LIST_BAD        4943        /* Prep version of -313    */
#define SQLA_RC_COLUMN_NOT_NULLABLE    -4944       /* Prep version of -407    */
#define SQLA_RC_STMT_MARKER_BAD        -4945       /* Prep version of -418    */
#define SQLA_RC_CURSOR_NOT_DECLARED    -4946       /* Prep version of -504    */
#define SQLA_RC_NO_USERDA_IN_CMPD      -4950
#define SQLA_RC_SQLDA_ID_BAD           -4951
#define SQLA_RC_SQLVAR_INDEX_BAD       -4952
#define SQLA_RC_CALL_TYPE_BAD          -4953
#define SQLA_RC_SECTION_BAD            -4954

/* Temporary value used in sqlca.sqlcode after an SQLAALOC function. Runtime  */
/* code can check sqlca.sqlcode to determine whether or not the SQLASETV      */
/* function needs to be called to initialize the sqlda sqlvar elements.       */
#define SQLA_RC_SQLVARS_SET    4959    /* sqlvars already initialized         */

/* Errors that cause Precompiler Services to enter the fatal error state.     */
/* After encountering one of these types of errors, Precompiler Services      */
/* requires an SQLAFINI and SQLAINIT call before it will continue.            */

#define SQLA_RC_INV_INSERT               SQL_RC_E803
#define SQLA_RC_INV_SQLDA_ADR            SQL_RC_E822
#define SQLA_RC_SYS_ERROR                SQL_RC_E902
#define SQLA_RC_DEADLOCK_ERR             SQL_RC_E911
#define SQLA_RC_FAT_SYS_ERR              SQL_RC_E912
#define SQLA_RC_TOO_MANY_LKS             SQL_RC_E930
#define SQLA_RC_STORAGE_ERR              SQL_RC_E954
#define SQLA_RC_DB_HEAP_ERR              SQL_RC_E956
#define SQLA_RC_TOOMANY_OFLS             SQL_RC_E958
#define SQLA_RC_TOOMANY_FILES            SQL_RC_E960
#define SQLA_RC_LOG_FULL                 SQL_RC_E964
#define SQLA_RC_FILE_SYS_FULL            SQL_RC_E968
#define SQLA_RC_READ_ONLY_FIL            SQL_RC_E970

#define SQLA_RC_INCORRECT_DSK            -972
#define SQLA_RC_DB_DRV_LOCKED            -974
#define SQLA_RC_DRV_DOOR_OPEN            -976
#define SQLA_RC_DISK_WRT_PRO             -978
#define SQLA_RC_FILESYSTEM_ACCESS        -10019

#define SQLA_RC_DISK_ERROR               SQL_RC_E980
#define SQLA_RC_DISK_ERR                 SQL_RC_E982
#define SQLA_RC_COMM_RB_ERR              SQL_RC_E984
#define SQLA_RC_CAT_FILE_ERR             SQL_RC_E985
#define SQLA_RC_TAB_FILE_ERR             SQL_RC_E986
#define SQLA_RC_INDEX_ERR                SQL_RC_E990
#define SQLA_RC_REL_NUM_BAD              SQL_RC_E992
#define SQLA_RC_AGENT_GONE               SQLE_RC_AGENT_GONE
#define SQLA_RC_CTRL_BREAK               -4994   /* Prep version of -952      */
#define SQLA_RC_CODEPAGE_BAD             -4995   /* Country info not found    */
#define SQLA_RC_SQLUSER_BAD              -4997   /* Prep version of -1046     */
#define SQLA_RC_DB_DISCONNECTED          -4998   /* Prep version of -1049     */
#define SQLA_RC_INTERNAL_ERR             -4999   /* Precompiler Services err  */

/******************************************************************************
** Target API constants for sqlaopts()
*******************************************************************************/
#define SQLAO_PREP_SVCS_API              0       /* Precompiler Services API  */
                                                 /* (sqlainit)                */

SQL_API_RC SQL_API_FN                            /* Parse an option string    */
                                                 /* and produce an option     */
                                                 /* array                     */
  sqlaopts (
        void *,                                  /* option string             */
        struct sqlopt *,                         /* option array              */
        void *,                                  /* database name (sqlainit   */
                                                 /* only)                     */
        void *,                                  /* userid (sqlainit only)    */
        void *,                                  /* password (sqlainit only)  */
        void *,                                  /* message file name         */
        void *,                                  /* package name (sqlainit    */
                                                 /* only)                     */
        void *,                                  /* bind file name (sqlainit  */
                                                 /* only)                     */
        long,                                    /* target API                */
        void **,                                 /* memory handle             */
        struct sqlca *);                         /* SQLCA                     */

SQL_API_RC SQL_API_FN                            /* Frees any memory          */
                                                 /* allocated by sqlaopts     */
  sqlaopts_free (
        void *,                                  /* memory handle returned    */
                                                 /* by sqlaopts               */
        struct sqlca *);                         /* SQLCA                     */

/******************************************************************************
** Precompiler Services Structures
*******************************************************************************/

/* Precompiler Option Array.  Used with SQLAINIT.                             */

SQL_STRUCTURE sqla_options_header
{
        unsigned long               allocated;
        unsigned long               used;
};

SQL_STRUCTURE sqla_option
{
        unsigned long               type;
        unsigned long               val;
};

SQL_STRUCTURE sqla_options
{
        struct sqla_options_header  header;
        struct sqla_option          option[1];
};

/* Program ID.  Used by Precompiler Services and Runtime Services             */
SQL_STRUCTURE sqla_program_id
{
        unsigned short    length;
        unsigned short    rp_rel_num;
        unsigned short    db_rel_num;
        unsigned short    bf_rel_num;
        char              sqluser[8];
        char              planname[8];
        char              contoken[8];
        char              buffer[8];
};

/* Indexes into the buffer field, showing the information it provides         */
#define SQLA_PGMID_STD         0
#define SQLA_PGMID_CONNECT     1
#define SQLA_PGMID_SQLRULES    2
#define SQLA_PGMID_DISCONNECT  3
#define SQLA_PGMID_SYNCPOINT   4
#define SQLA_INT_TO_ASCII_DIFF 48

/* Number of DUOW connection options                                          */
#define SQLA_PGMID_CONNOPTS    4

/* Precompiler Task Array.  Used with SQLACMPL.                               */

SQL_STRUCTURE sqla_tasks_header
{
        unsigned long               allocated;
        unsigned long               used;
};

SQL_STRUCTURE sqla_task
{
        unsigned long               func;
        unsigned long               val;
};

SQL_STRUCTURE sqla_tasks
{
        struct sqla_tasks_header    header;
        struct sqla_task            task[1];
};

/* Token return structure.  Used to return length and offset of               */
/* a token within an SQL statement.  May be overlaid on top of                */
/* the val member of the task array or on top of the id member                */
/* of the token id array.                                                     */
SQL_STRUCTURE sqla_return_token
{
        unsigned short    offset;
        unsigned short    length;
};

/* Precompiler Token ID Array.  Used with SQLACMPL.                           */

SQL_STRUCTURE sqla_tokens_header
{
        unsigned long               allocated;
        unsigned long               used;
};

SQL_STRUCTURE sqla_token
{
        unsigned long               id;
        unsigned long               use;
};

SQL_STRUCTURE sqla_tokens
{
        struct sqla_tokens_header   header;
        struct sqla_token           token[1];
};

/* Flagger information area. Used with SQLACMPL and SQLGCMPL.                 */
SQL_STRUCTURE sqla_flagmsgs
{
        short             count;
        short             padding;
        SQL_STRUCTURE sqlca sqlca[SQLA_FLAG_MAXMSGS];
};

SQL_STRUCTURE sqla_flaginfo
{
        short             version;
        short             padding;
        struct            sqla_flagmsgs msgs;
};
/* Precompiler Services Prototypes                                            */

/* NOTE: sqlaahvr has been obsoleted in favor of sqlaalhv.  sqlaahvr will be  */
/* unavailable in future releases.                                            */
SQL_API_RC SQL_API_FN                      /* Add a host variable             */
                                           /* declaration (obsolete)          */
  sqlaahvr (
        unsigned short *,                  /* host variable name length       */
        char *,                            /* host variable name              */
        unsigned short *,                  /* host variable SQL data type     */
        unsigned short *,                  /* host variable length            */
        unsigned long *,                   /* host variable token id          */
        unsigned short *,                  /* host variable location          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Add a host variable             */
                                           /* declaration                     */
  sqlaalhv (
        unsigned short *,                  /* host variable name length       */
        char *,                            /* host variable name              */
        unsigned short *,                  /* host variable SQL data type     */
        unsigned long *,                   /* host variable length            */
        unsigned long *,                   /* host variable token id          */
        unsigned short *,                  /* host variable location          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Compile an sql statement        */
  sqlacmpl (
        unsigned short *,                  /* SQL statement text length       */
        char *,                            /* SQL statement text              */
        unsigned short *,                  /* source line number              */
        struct sqla_tasks *,               /* task array                      */
        struct sqla_tokens *,              /* token id array                  */
        unsigned short *,                  /* section number                  */
        unsigned short *,                  /* type of SQL statement           */
        char *,                            /* 128 byte string buffer 1        */
        char *,                            /* 128 byte string buffer 2        */
        char *,                            /* 128 byte string buffer 3        */
        struct sqla_flaginfo *,            /* SQL Flagger information         */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Terminate an access plan        */
  sqlafini (
        unsigned short *,                  /* save/discard plan/bind file     */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Initialize an access plan       */
  sqlainit (
        unsigned short *,                  /* program name length             */
        char *,                            /* program name                    */
        unsigned short *,                  /* database name length            */
        char *,                            /* database name                   */
        unsigned short *,                  /* password length                 */
        char *,                            /* database password               */
        unsigned short *,                  /* bind file name length           */
        char *,                            /* bind file name                  */
        struct sqla_options *,             /* precompiler option array        */
        struct sqla_program_id *,          /* precompiler program ID          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

/* Generic Precompiler Services Prototypes                                    */

/* NOTE: sqlgahvr has been obsoleted in favor of sqlgalhv.  sqlgahvr will be  */
/* unavailable in future releases.                                            */
SQL_API_RC SQL_API_FN                      /* Add a host variable             */
                                           /* declaration (obsolete)          */
  sqlgahvr (
        unsigned short *,                  /* host variable name length       */
        char *,                            /* host variable name              */
        unsigned short *,                  /* host variable SQL data type     */
        unsigned short *,                  /* host variable length            */
        unsigned long *,                   /* host variable token id          */
        unsigned short *,                  /* host variable location          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Add a host variable             */
                                           /* declaration                     */
  sqlgalhv (
        unsigned short *,                  /* host variable name length       */
        char *,                            /* host variable name              */
        unsigned short *,                  /* host variable SQL data type     */
        unsigned long *,                   /* host variable length            */
        unsigned long *,                   /* host variable token id          */
        unsigned short *,                  /* host variable location          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Compile an sql statement        */
  sqlgcmpl (
        unsigned short *,                  /* SQL statement text length       */
        char *,                            /* SQL statement text              */
        unsigned short *,                  /* source line number              */
        struct sqla_tasks *,               /* task array                      */
        struct sqla_tokens *,              /* token id array                  */
        unsigned short *,                  /* section number                  */
        unsigned short *,                  /* type of SQL statement           */
        char *,                            /* 128 byte string buffer 1        */
        char *,                            /* 128 byte string buffer 2        */
        char *,                            /* 128 byte string buffer 3        */
        struct sqla_flaginfo *,            /* SQL Flagger information         */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Terminate an access plan        */
  sqlgfini (
        unsigned short *,                  /* save/discard plan/bind file     */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Initialize an access plan       */
  sqlginit (
        unsigned short *,                  /* program name length             */
        char *,                            /* program name                    */
        unsigned short *,                  /* database name length            */
        char *,                            /* database name                   */
        unsigned short *,                  /* password length                 */
        char *,                            /* database password               */
        unsigned short *,                  /* bind file name length           */
        char *,                            /* bind file name                  */
        struct sqla_options *,             /* precompiler option array        */
        struct sqla_program_id *,          /* precompiler program ID          */
        void *,                            /* reserved                        */
        struct sqlca *);                   /* SQLCA                           */

/* Generic Runtime Services Prototypes                                        */

SQL_API_RC SQL_API_FN
  sqlgaloc (
        unsigned short,                    /* sqlda identification number     */
        unsigned short,                    /* number of sqlvar elements       */
                                           /* needed                          */
        unsigned short,                    /* statement identification        */
                                           /* number                          */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgcall (
        unsigned short,                    /* function call type              */
        unsigned short,                    /* access plan section or          */
                                           /* statement type                  */
        unsigned short,                    /* input SQLDA ID                  */
        unsigned short,                    /* output SQLDA ID                 */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgcmpd (
        unsigned short,                    /* function call type              */
        unsigned short,                    /* access plan section             */
        unsigned short,                    /* input SQLDA ID                  */
        unsigned short,                    /* output SQLDA ID                 */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgdloc (
        unsigned short,                    /* SQLDA ID                        */
        void *);                           /* reserved                        */

/* NOTE: sqlgsets has been obsoleted in favor of sqlgstls.  sqlgsets will be  */
/* unavailable in future releases.                                            */
SQL_API_RC SQL_API_FN
  sqlgsets (
        unsigned short,                    /* SQL statement text length       */
        const void *,                      /* SQL statement text              */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgstls (
        unsigned long,                     /* SQL statement text length       */
        const void *,                      /* SQL statement text              */
        void *);                           /* reserved                        */

/* NOTE: sqlgsetv has been obsoleted in favor of sqlgstlv.  sqlgsetv will be  */
/* unavailable in future releases.                                            */
SQL_API_RC SQL_API_FN
  sqlgsetv (
        unsigned short,                    /* SQLDA ID                        */
        unsigned short,                    /* sqlvar element                  */
        unsigned short,                    /* SQL data type                   */
        unsigned short,                    /* declared length                 */
        void *,                            /* address of host var             */
        short *,                           /* address of indicator var        */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgstlv (
        unsigned short,                    /* SQLDA ID                        */
        unsigned short,                    /* sqlvar element                  */
        unsigned short,                    /* SQL data type                   */
        unsigned long,                     /* declared length                 */
        void *,                            /* address of host var             */
        short *,                           /* address of indicator var        */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgstop (
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN
  sqlgstrt (
        char[40],                          /* runtime program ID              */
        struct sqla_runtime_info *,        /* runtime information             */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN
  sqlgusda (
        unsigned short,                    /* SQLDA ID                        */
        struct sqlda *,                    /* SQLDA                           */
        void *);                           /* reserved                        */

SQL_API_RC SQL_API_FN                      /* Parse an option string and      */
                                           /* produce an option array         */
  sqlgopts (
        void *,                            /* option string                   */
        struct sqlopt *,                   /* option array                    */
        void *,                            /* database name (sqlainit only)   */
        void *,                            /* userid (sqlainit only)          */
        void *,                            /* password (sqlainit only)        */
        void *,                            /* message file name               */
        void *,                            /* package name (sqlainit only)    */
        void *,                            /* bind file name (sqlainit only)  */
        long,                              /* target API                      */
        void **,                           /* memory handle                   */
        struct sqlca *);                   /* SQLCA                           */

SQL_API_RC SQL_API_FN                      /* Frees any memory allocated by   */
                                           /* sqlaopts                        */
  sqlgopts_free (
        void *,                            /* memory handle returned by       */
                                           /* sqlaopts                        */
        struct sqlca *);                   /* SQLCA                           */

#pragma options align=reset

#ifdef __cplusplus 
}
#endif

#endif /* SQL_H_SQLAPREP */
L statk $ $        5  ˸5˸5͸5         ,  5      ./usr/lpp/db2_02_01/include/sqlcli1.h  .                    $          /******************************************************************************
 *
 * Source File Name = SQLCLI1.H
 *
 * (C) COPYRIGHT International Business Machines Corp. 1993, 1995
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 *
 * US Government Users Restricted Rights - Use, duplication or
 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 *
 * Function = Include File defining:
 *              DB2 CLI Interface - Constants
 *              DB2 CLI Interface - Function Prototypes
 *
 * Operating System = Common C Include File
 *
 *****************************************************************************/

#ifndef SQL_H_SQLCLI1
   #define SQL_H_SQLCLI1           /* Permit duplicate Includes */


#ifdef __cplusplus
extern "C" {
#endif

#include "sqlsystm.h"              /* System dependent defines  */


#if defined(DB2WIN) || defined(DB2NT)
#include <windows.h>
#endif
#ifdef DB2OS2
#define INCL_WIN
#define INCL_DOS
#include <os2.h>
#endif

#include    "sqlca.h"
#include    "sqlcli.h"

/* generally useful constants */
#define SQL_MAX_OPTION_STRING_LENGTH    256

/* Access modes */
#define SQL_MODE_READ_WRITE             0
#define SQL_MODE_READ_ONLY              1

/* Special return values for SQLFetch/SQLExtendedFetch/SQLGetData */
#define SQL_NO_TOTAL                   (-4)

/* SQLGetFunction defines  - supported functions */
#define  SQL_API_ALL_FUNCTIONS          0
#define  SQL_API_SQLALLOCCONNECT        1
#define  SQL_API_SQLALLOCENV            2
#define  SQL_API_SQLALLOCSTMT           3
#define  SQL_API_SQLBINDCOL             4
#define  SQL_API_SQLCANCEL              5
#define  SQL_API_SQLCOLATTRIBUTES       6
#define  SQL_API_SQLCONNECT             7
#define  SQL_API_SQLDESCRIBECOL         8
#define  SQL_API_SQLDISCONNECT          9
#define  SQL_API_SQLERROR              10
#define  SQL_API_SQLEXECDIRECT         11
#define  SQL_API_SQLEXECUTE            12
#define  SQL_API_SQLFETCH              13
#define  SQL_API_SQLFREECONNECT        14
#define  SQL_API_SQLFREEENV            15
#define  SQL_API_SQLFREESTMT           16
#define  SQL_API_SQLGETCURSORNAME      17
#define  SQL_API_SQLNUMRESULTCOLS      18
#define  SQL_API_SQLPREPARE            19
#define  SQL_API_SQLROWCOUNT           20
#define  SQL_API_SQLSETCURSORNAME      21
#define  SQL_API_SQLSETPARAM           22
#define  SQL_API_SQLTRANSACT           23

#define  SQL_API_SQLCOLUMNS            40
#define  SQL_API_SQLDRIVERCONNECT      41
#define  SQL_API_SQLGETCONNECTOPTION   42
#define  SQL_API_SQLGETDATA            43
#define  SQL_API_SQLGETFUNCTIONS       44
#define  SQL_API_SQLGETINFO            45
#define  SQL_API_SQLGETSTMTOPTION      46
#define  SQL_API_SQLGETTYPEINFO        47
#define  SQL_API_SQLPARAMDATA          48
#define  SQL_API_SQLPUTDATA            49
#define  SQL_API_SQLSETCONNECTOPTION   50
#define  SQL_API_SQLSETSTMTOPTION      51
#define  SQL_API_SQLSPECIALCOLUMNS     52
#define  SQL_API_SQLSTATISTICS         53
#define  SQL_API_SQLTABLES             54
#define  SQL_API_SQLCOLUMNPRIVILEGES   56
#define  SQL_API_SQLDATASOURCES        57
#define  SQL_API_SQLEXTENDEDFETCH      59
#define  SQL_API_SQLFOREIGNKEYS        60
#define  SQL_API_SQLMORERESULTS        61
#define  SQL_API_SQLNATIVESQL          62
#define  SQL_API_SQLNUMPARAMS          63
#define  SQL_API_SQLPARAMOPTIONS       64
#define  SQL_API_SQLPRIMARYKEYS        65
#define  SQL_API_SQLPROCEDURECOLUMNS   66
#define  SQL_API_SQLPROCEDURES         67
#define  SQL_API_SQLSETSCROLLOPTIONS   69
#define  SQL_API_SQLTABLEPRIVILEGES    70
#define  SQL_API_SQLBINDPARAMETER      72

#define  SQL_API_SQLBINDFILETOCOL      1250
#define  SQL_API_SQLBINDFILETOPARAM    1251
#define  SQL_API_SQLSETCOLATTRIBUTES   1252
#define  SQL_API_SQLGETSQLCA           1253

#define  SQL_API_SQLGETLENGTH          1022
#define  SQL_API_SQLGETPOSITION        1023
#define  SQL_API_SQLGETSUBSTRING       1024

#define  SQL_API_SQLGETENVATTR         1012
#define  SQL_API_SQLSETENVATTR         1019
#define  SQL_API_SQLSETCONNECTION      1254

/* SQLGetFunction defines  - unsupported functions */
#define  SQL_API_SQLBROWSECONNECT      55
#define  SQL_API_SQLDESCRIBEPARAM      58
#define  SQL_API_SQLSETPOS             68
#define  SQL_API_SQLDRIVERS            71
#define  SQL_EXT_API_LAST              SQL_API_SQLBINDPARAMETER


/* SQLGetInfo defines  - Info Type */
#define  SQL_ACTIVE_CONNECTIONS                0
#define  SQL_ACTIVE_STATEMENTS                 1
#define  SQL_DATA_SOURCE_NAME                  2
#define  SQL_DRIVER_HDBC                       3
#define  SQL_DRIVER_HENV                       4
#define  SQL_DRIVER_HSTMT                      5
#define  SQL_DRIVER_NAME                       6
#define  SQL_DRIVER_VER                        7
#define  SQL_FETCH_DIRECTION                   8
#define  SQL_ODBC_API_CONFORMANCE              9
#define  SQL_ODBC_VER                         10
#define  SQL_ROW_UPDATES                      11
#define  SQL_ODBC_SAG_CLI_CONFORMANCE         12
#define  SQL_SERVER_NAME                      13
#define  SQL_SEARCH_PATTERN_ESCAPE            14
#define  SQL_ODBC_SQL_CONFORMANCE             15
#define  SQL_DATABASE_NAME                    16
#define  SQL_DBMS_NAME                        17
#define  SQL_DBMS_VER                         18
#define  SQL_ACCESSIBLE_TABLES                19
#define  SQL_ACCESSIBLE_PROCEDURES            20
#define  SQL_PROCEDURES                       21
#define  SQL_CONCAT_NULL_BEHAVIOR             22
#define  SQL_CURSOR_COMMIT_BEHAVIOR           23
#define  SQL_CURSOR_ROLLBACK_BEHAVIOR         24
#define  SQL_DATA_SOURCE_READ_ONLY            25
#define  SQL_DEFAULT_TXN_ISOLATION            26
#define  SQL_EXPRESSIONS_IN_ORDERBY           27
#define  SQL_IDENTIFIER_CASE                  28
#define  SQL_IDENTIFIER_QUOTE_CHAR            29
#define  SQL_MAX_COLUMN_NAME_LEN              30
#define  SQL_MAX_CURSOR_NAME_LEN              31
#define  SQL_MAX_OWNER_NAME_LEN               32
#define  SQL_MAX_PROCEDURE_NAME_LEN           33
#define  SQL_MAX_QUALIFIER_NAME_LEN           34
#define  SQL_MAX_TABLE_NAME_LEN               35
#define  SQL_MULT_RESULT_SETS                 36
#define  SQL_MULTIPLE_ACTIVE_TXN              37
#define  SQL_OUTER_JOINS                      38
#define  SQL_OWNER_TERM                       39
#define  SQL_PROCEDURE_TERM                   40
#define  SQL_QUALIFIER_NAME_SEPARATOR         41
#define  SQL_QUALIFIER_TERM                   42
#define  SQL_SCROLL_CONCURRENCY               43
#define  SQL_SCROLL_OPTIONS                   44
#define  SQL_TABLE_TERM                       45
#define  SQL_TXN_CAPABLE                      46
#define  SQL_USER_NAME                        47
#define  SQL_CONVERT_FUNCTIONS                48
#define  SQL_NUMERIC_FUNCTIONS                49
#define  SQL_STRING_FUNCTIONS                 50
#define  SQL_SYSTEM_FUNCTIONS                 51
#define  SQL_TIMEDATE_FUNCTIONS               52
#define  SQL_CONVERT_BIGINT                   53
#define  SQL_CONVERT_BINARY                   54
#define  SQL_CONVERT_BIT                      55
#define  SQL_CONVERT_CHAR                     56
#define  SQL_CONVERT_DATE                     57
#define  SQL_CONVERT_DECIMAL                  58
#define  SQL_CONVERT_DOUBLE                   59
#define  SQL_CONVERT_FLOAT                    60
#define  SQL_CONVERT_INTEGER                  61
#define  SQL_CONVERT_LONGVARCHAR              62
#define  SQL_CONVERT_NUMERIC                  63
#define  SQL_CONVERT_REAL                     64
#define  SQL_CONVERT_SMALLINT                 65
#define  SQL_CONVERT_TIME                     66
#define  SQL_CONVERT_TIMESTAMP                67
#define  SQL_CONVERT_TINYINT                  68
#define  SQL_CONVERT_VARBINARY                69
#define  SQL_CONVERT_VARCHAR                  70
#define  SQL_CONVERT_LONGVARBINARY            71
#define  SQL_TXN_ISOLATION_OPTION             72
#define  SQL_ODBC_SQL_OPT_IEF                 73
#define  SQL_CORRELATION_NAME                 74
#define  SQL_NON_NULLABLE_COLUMNS             75
#define  SQL_DRIVER_HLIB                      76
#define  SQL_DRIVER_ODBC_VER                  77
#define  SQL_LOCK_TYPES                       78
#define  SQL_POS_OPERATIONS                   79
#define  SQL_POSITIONED_STATEMENTS            80
#define  SQL_GETDATA_EXTENSIONS               81
#define  SQL_BOOKMARK_PERSISTENCE             82
#define  SQL_STATIC_SENSITIVITY               83
#define  SQL_FILE_USAGE                       84
#define  SQL_NULL_COLLATION                   85
#define  SQL_ALTER_TABLE                      86
#define  SQL_COLUMN_ALIAS                     87
#define  SQL_GROUP_BY                         88
#define  SQL_KEYWORDS                         89
#define  SQL_ORDER_BY_COLUMNS_IN_SELECT       90
#define  SQL_OWNER_USAGE                      91
#define  SQL_QUALIFIER_USAGE                  92
#define  SQL_QUOTED_IDENTIFIER_CASE           93
#define  SQL_SPECIAL_CHARACTERS               94
#define  SQL_SUBQUERIES                       95
#define  SQL_UNION                            96
#define  SQL_MAX_COLUMNS_IN_GROUP_BY          97
#define  SQL_MAX_COLUMNS_IN_INDEX             98
#define  SQL_MAX_COLUMNS_IN_ORDER_BY          99
#define  SQL_MAX_COLUMNS_IN_SELECT           100
#define  SQL_MAX_COLUMNS_IN_TABLE            101
#define  SQL_MAX_INDEX_SIZE                  102
#define  SQL_MAX_ROW_SIZE_INCLUDES_LONG      103
#define  SQL_MAX_ROW_SIZE                    104
#define  SQL_MAX_STATEMENT_LEN               105
#define  SQL_MAX_TABLES_IN_SELECT            106
#define  SQL_MAX_USER_NAME_LEN               107
#define  SQL_MAX_CHAR_LITERAL_LEN            108
#define  SQL_TIMEDATE_ADD_INTERVALS          109
#define  SQL_TIMEDATE_DIFF_INTERVALS         110
#define  SQL_NEED_LONG_DATA_LEN              111
#define  SQL_MAX_BINARY_LITERAL_LEN          112
#define  SQL_LIKE_ESCAPE_CLAUSE              113
#define  SQL_QUALIFIER_LOCATION              114
#define  SQL_OJ_CAPABILITIES               65003  /* Temporary value */
#define  SQL_MAX_SCHEMA_NAME_LEN             SQL_MAX_OWNER_NAME_LEN
#define  SQL_MAX_CATALOG_NAME_LEN            SQL_MAX_QUALIFIER_NAME_LEN


#define SQL_INFO_LAST                         SQL_QUALIFIER_LOCATION
#define SQL_INFO_DRIVER_START                 1000

/* SQL_CONVERT_*  return value bitmasks - for use with SQLGetInfo */
#define  SQL_CVT_CHAR                 0x00000001L
#define  SQL_CVT_NUMERIC              0x00000002L
#define  SQL_CVT_DECIMAL              0x00000004L
#define  SQL_CVT_INTEGER              0x00000008L
#define  SQL_CVT_SMALLINT             0x00000010L
#define  SQL_CVT_FLOAT                0x00000020L
#define  SQL_CVT_REAL                 0x00000040L
#define  SQL_CVT_DOUBLE               0x00000080L
#define  SQL_CVT_VARCHAR              0x00000100L
#define  SQL_CVT_LONGVARCHAR          0x00000200L
#define  SQL_CVT_BINARY               0x00000400L
#define  SQL_CVT_VARBINARY            0x00000800L
#define  SQL_CVT_BIT                  0x00001000L
#define  SQL_CVT_TINYINT              0x00002000L
#define  SQL_CVT_BIGINT               0x00004000L
#define  SQL_CVT_DATE                 0x00008000L
#define  SQL_CVT_TIME                 0x00010000L
#define  SQL_CVT_TIMESTAMP            0x00020000L
#define  SQL_CVT_LONGVARBINARY        0x00040000L

/* SQL_CONVERT_FUNCTIONS functions - for use with SQLGetInfo */
#define  SQL_FN_CVT_CONVERT           0x00000001L

/* SQL_STRING_FUNCTIONS Bit Masks  - for use with SQLGetInfo */
#define  SQL_FN_STR_CONCAT            0x00000001L
#define  SQL_FN_STR_INSERT            0x00000002L
#define  SQL_FN_STR_LEFT              0x00000004L
#define  SQL_FN_STR_LTRIM             0x00000008L
#define  SQL_FN_STR_LENGTH            0x00000010L
#define  SQL_FN_STR_LOCATE            0x00000020L
#define  SQL_FN_STR_LCASE             0x00000040L
#define  SQL_FN_STR_REPEAT            0x00000080L
#define  SQL_FN_STR_REPLACE           0x00000100L
#define  SQL_FN_STR_RIGHT             0x00000200L
#define  SQL_FN_STR_RTRIM             0x00000400L
#define  SQL_FN_STR_SUBSTRING         0x00000800L
#define  SQL_FN_STR_UCASE             0x00001000L
#define  SQL_FN_STR_ASCII             0x00002000L
#define  SQL_FN_STR_CHAR              0x00004000L
#define  SQL_FN_STR_DIFFERENCE        0x00008000L
#define  SQL_FN_STR_LOCATE_2          0x00010000L
#define  SQL_FN_STR_SOUNDEX           0x00020000L
#define  SQL_FN_STR_SPACE             0x00040000L

/* SQL_NUMERIC_FUNCTIONS Bit Masks - for use with SQLGetInfo */
#define  SQL_FN_NUM_ABS               0x00000001L
#define  SQL_FN_NUM_ACOS              0x00000002L
#define  SQL_FN_NUM_ASIN              0x00000004L
#define  SQL_FN_NUM_ATAN              0x00000008L
#define  SQL_FN_NUM_ATAN2             0x00000010L
#define  SQL_FN_NUM_CEILING           0x00000020L
#define  SQL_FN_NUM_COS               0x00000040L
#define  SQL_FN_NUM_COT               0x00000080L
#define  SQL_FN_NUM_EXP               0x00000100L
#define  SQL_FN_NUM_FLOOR             0x00000200L
#define  SQL_FN_NUM_LOG               0x00000400L
#define  SQL_FN_NUM_MOD               0x00000800L
#define  SQL_FN_NUM_SIGN              0x00001000L
#define  SQL_FN_NUM_SIN               0x00002000L
#define  SQL_FN_NUM_SQRT              0x00004000L
#define  SQL_FN_NUM_TAN               0x00008000L
#define  SQL_FN_NUM_PI                0x00010000L
#define  SQL_FN_NUM_RAND              0x00020000L
#define  SQL_FN_NUM_DEGREES           0x00040000L
#define  SQL_FN_NUM_LOG10             0x00080000L
#define  SQL_FN_NUM_POWER             0x00100000L
#define  SQL_FN_NUM_RADIANS           0x00200000L
#define  SQL_FN_NUM_ROUND             0x00400000L
#define  SQL_FN_NUM_TRUNCATE          0x00800000L

/* SQL_TIMEDATE_FUNCTIONS Bit Masks - for use with SQLGetInfo */
#define  SQL_FN_TD_NOW                0x00000001L
#define  SQL_FN_TD_CURDATE            0x00000002L
#define  SQL_FN_TD_DAYOFMONTH         0x00000004L
#define  SQL_FN_TD_DAYOFWEEK          0x00000008L
#define  SQL_FN_TD_DAYOFYEAR          0x00000010L
#define  SQL_FN_TD_MONTH              0x00000020L
#define  SQL_FN_TD_QUARTER            0x00000040L
#define  SQL_FN_TD_WEEK               0x00000080L
#define  SQL_FN_TD_YEAR               0x00000100L
#define  SQL_FN_TD_CURTIME            0x00000200L
#define  SQL_FN_TD_HOUR               0x00000400L
#define  SQL_FN_TD_MINUTE             0x00000800L
#define  SQL_FN_TD_SECOND             0x00001000L
#define  SQL_FN_TD_TIMESTAMPADD       0x00002000L
#define  SQL_FN_TD_TIMESTAMPDIFF      0x00004000L
#define  SQL_FN_TD_DAYNAME            0x00008000L
#define  SQL_FN_TD_MONTHNAME          0x00010000L
#define  SQL_FN_TD_SECONDS_SINCE_MIDNIGHT 0x00020000L
#define  SQL_FN_TD_JULIAN_DAY         0x00040000L

/* SQL_SYSTEM_FUNCTIONS Bit Masks - for use with SQLGetInfo */
#define  SQL_FN_SYS_USERNAME          0x00000001L
#define  SQL_FN_SYS_DBNAME            0x00000002L
#define  SQL_FN_SYS_IFNULL            0x00000004L

/* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS Bit Masks
 * - for use with SQLGetInfo
 */
#define SQL_FN_TSI_FRAC_SECOND        0x00000001L
#define SQL_FN_TSI_SECOND             0x00000002L
#define SQL_FN_TSI_MINUTE             0x00000004L
#define SQL_FN_TSI_HOUR               0x00000008L
#define SQL_FN_TSI_DAY                0x00000010L
#define SQL_FN_TSI_WEEK               0x00000020L
#define SQL_FN_TSI_MONTH              0x00000040L
#define SQL_FN_TSI_QUARTER            0x00000080L
#define SQL_FN_TSI_YEAR               0x00000100L


/* SQL_ODBC_API_CONFORMANCE values */
#define SQL_OAC_NONE                  0x0000
#define SQL_OAC_LEVEL1                0x0001
#define SQL_OAC_LEVEL2                0x0002


/* SQL_ODBC_SAG_CLI_CONFORMANCE values */

#define SQL_OSCC_NOT_COMPLIANT        0x0000
#define SQL_OSCC_COMPLIANT            0x0001

/* SQL_ODBC_SQL_CONFORMANCE values */

#define SQL_OSC_MINIMUM               0x0000
#define SQL_OSC_CORE                  0x0001
#define SQL_OSC_EXTENDED              0x0002

/* SQL_CONCAT_NULL_BEHAVIOR values */

#define SQL_CB_NULL                   0x0000
#define SQL_CB_NON_NULL               0x0001

/* SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR values */

#define SQL_CB_DELETE                 0x0000
#define SQL_CB_CLOSE                  0x0001
#define SQL_CB_PRESERVE               0x0002

/* SQL_IDENTIFIER_CASE values */

#define SQL_IC_UPPER                  0x0001
#define SQL_IC_LOWER                  0x0002
#define SQL_IC_SENSITIVE              0x0003
#define SQL_IC_MIXED                  0x0004

/* SQL_TXN_CAPABLE values */

#define SQL_TC_NONE                   0x0000
#define SQL_TC_DML                    0x0001
#define SQL_TC_ALL                    0x0002
#define SQL_TC_DDL_COMMIT             0x0003
#define SQL_TC_DDL_IGNORE             0x0004

/* SQL_SCROLL_OPTIONS masks */

#define SQL_SO_FORWARD_ONLY           0x00000001L
#define SQL_SO_KEYSET_DRIVEN          0x00000002L
#define SQL_SO_DYNAMIC                0x00000004L
#define SQL_SO_MIXED                  0x00000008L
#define SQL_SO_STATIC                 0x00000010L

/* SQL_SCROLL_CONCURRENCY masks */

#define SQL_SCCO_READ_ONLY            0x00000001L
#define SQL_SCCO_LOCK                 0x00000002L
#define SQL_SCCO_OPT_ROWVER           0x00000004L
#define SQL_SCCO_OPT_VALUES           0x00000008L
#define SQL_SCCO_OPT_TIMESTAMP        SQL_SCCO_OPT_ROWVER   /* deprecated */

/* SQL_FETCH_DIRECTION masks */

#define  SQL_FD_FETCH_NEXT            0x00000001L
#define  SQL_FD_FETCH_FIRST           0x00000002L
#define  SQL_FD_FETCH_LAST            0x00000004L
#define  SQL_FD_FETCH_PREV            0x00000008L
#define  SQL_FD_FETCH_ABSOLUTE        0x00000010L
#define  SQL_FD_FETCH_RELATIVE        0x00000020L
#define  SQL_FD_FETCH_RESUME          0x00000040L
#define  SQL_FD_FETCH_BOOKMARK        0x00000080L

/* SQL_TXN_ISOLATION_OPTION masks */
#define  SQL_TXN_READ_UNCOMMITTED     0x00000001L
#define  SQL_TXN_READ_COMMITTED       0x00000002L
#define  SQL_TXN_REPEATABLE_READ      0x00000004L
#define  SQL_TXN_SERIALIZABLE         0x00000008L
#define  SQL_TXN_VERSIONING           0x00000010L
#define  SQL_TXN_NOCOMMIT             0x00000020L

/* SQL_CORRELATION_NAME values */

#define SQL_CN_NONE                   0x0000
#define SQL_CN_DIFFERENT              0x0001
#define SQL_CN_ANY                    0x0002

/* SQL_NON_NULLABLE_COLUMNS values */

#define SQL_NNC_NULL                  0x0000
#define SQL_NNC_NON_NULL              0x0001

/* SQL_NULL_COLLATION values */

#define SQL_NC_HIGH                   0x0000
#define SQL_NC_LOW                    0x0001
#define SQL_NC_START                  0x0002
#define SQL_NC_END                    0x0040

/* SQL_FILE_USAGE values */

#define SQL_FILE_NOT_SUPPORTED        0x0000
#define SQL_FILE_TABLE                0x0001
#define SQL_FILE_QUALIFIER            0x0002

/* SQL_GETDATA_EXTENSIONS values */

#define SQL_GD_ANY_COLUMN             0x00000001L
#define SQL_GD_ANY_ORDER              0x00000002L
#define SQL_GD_BLOCK                  0x00000004L
#define SQL_GD_BOUND                  0x00000008L

/* SQL_ALTER_TABLE values */

#define SQL_AT_ADD_COLUMN             0x00000001L
#define SQL_AT_DROP_COLUMN            0x00000002L

/* SQL_POSITIONED_STATEMENTS masks */

#define SQL_PS_POSITIONED_DELETE      0x00000001L
#define SQL_PS_POSITIONED_UPDATE      0x00000002L
#define SQL_PS_SELECT_FOR_UPDATE      0x00000004L

/* SQL_GROUP_BY values */

#define SQL_GB_NOT_SUPPORTED            0x0000
#define SQL_GB_GROUP_BY_EQUALS_SELECT   0x0001
#define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
#define SQL_GB_NO_RELATION              0x0003

/* SQL_OWNER_USAGE masks */

#define SQL_OU_DML_STATEMENTS         0x00000001L
#define SQL_OU_PROCEDURE_INVOCATION   0x00000002L
#define SQL_OU_TABLE_DEFINITION       0x00000004L
#define SQL_OU_INDEX_DEFINITION       0x00000008L
#define SQL_OU_PRIVILEGE_DEFINITION   0x00000010L

/* SQL_QUALIFIER_USAGE masks */

#define SQL_QU_DML_STATEMENTS         0x00000001L
#define SQL_QU_PROCEDURE_INVOCATION   0x00000002L
#define SQL_QU_TABLE_DEFINITION       0x00000004L
#define SQL_QU_INDEX_DEFINITION       0x00000008L
#define SQL_QU_PRIVILEGE_DEFINITION   0x00000010L

/* SQL_SUBQUERIES masks */

#define SQL_SQ_COMPARISON             0x00000001L
#define SQL_SQ_EXISTS                 0x00000002L
#define SQL_SQ_IN                     0x00000004L
#define SQL_SQ_QUANTIFIED             0x00000008L
#define SQL_SQ_CORRELATED_SUBQUERIES  0x00000010L

/* SQL_UNION masks */

#define SQL_U_UNION                   0x00000001L
#define SQL_U_UNION_ALL               0x00000002L

/* SQL_BOOKMARK_PERSISTENCE values */

#define SQL_BP_CLOSE                  0x00000001L
#define SQL_BP_DELETE                 0x00000002L
#define SQL_BP_DROP                   0x00000004L
#define SQL_BP_TRANSACTION            0x00000008L
#define SQL_BP_UPDATE                 0x00000010L
#define SQL_BP_OTHER_HSTMT            0x00000020L
#define SQL_BP_SCROLL                 0x00000040L

/* SQL_STATIC_SENSITIVITY values */

#define SQL_SS_ADDITIONS              0x00000001L
#define SQL_SS_DELETIONS              0x00000002L
#define SQL_SS_UPDATES                0x00000004L

/* SQL_LOCK_TYPES masks */

#define SQL_LCK_NO_CHANGE             0x00000001L
#define SQL_LCK_EXCLUSIVE             0x00000002L
#define SQL_LCK_UNLOCK                0x00000004L

/* SQL_POS_OPERATIONS masks */

#define SQL_POS_POSITION              0x00000001L
#define SQL_POS_REFRESH               0x00000002L
#define SQL_POS_UPDATE                0x00000004L
#define SQL_POS_DELETE                0x00000008L
#define SQL_POS_ADD                   0x00000010L

/* SQL_QUALIFIER_LOCATION values */

#define SQL_QL_START                  0x0001L
#define SQL_QL_END                    0x0002L

/* SQL_OJ_CAPABILITIES values */

#define SQL_OJ_LEFT                   0x00000001L
#define SQL_OJ_RIGHT                  0x00000002L
#define SQL_OJ_FULL                   0x00000004L
#define SQL_OJ_NESTED                 0x00000008L
#define SQL_OJ_NOT_ORDERED            0x00000010L
#define SQL_OJ_INNER                  0x00000020L
#define SQL_OJ_ALL_COMPARISON_OPS     0x00000040L


/* SQLGetTypeInfo define */
#define  SQL_ALL_TYPES                0

/* Options for SQLGetStmtOption/SQLSetStmtOption */
#define  SQL_QUERY_TIMEOUT      0
#define  SQL_MAX_ROWS           1
#define  SQL_NOSCAN             2
#define  SQL_MAX_LENGTH         3
#define  SQL_ASYNC_ENABLE       4
#define  SQL_BIND_TYPE          5
#define  SQL_CURSOR_TYPE        6
#define  SQL_CONCURRENCY        7
#define  SQL_KEYSET_SIZE        8
#define  SQL_ROWSET_SIZE        9
#define  SQL_SIMULATE_CURSOR    10
#define  SQL_RETRIEVE_DATA      11
#define  SQL_USE_BOOKMARKS      12
#define  SQL_GET_BOOKMARK       13
#define  SQL_ROW_NUMBER         14

/* Options for SQLGetStmtOption/SQLSetStmtOption extensions */
#define  SQL_CURSOR_HOLD        1250
#define  SQL_NODESCRIBE_OUTPUT  1251

#define  SQL_NODESCRIBE_INPUT   1264
#define  SQL_NODESCRIBE         SQL_NODESCRIBE_OUTPUT
#define  SQL_CLOSE_BEHAVIOR     1257

/* Deprecated options */

#define  SQL_MOVE_INPUT_SQLDA   1266
#define  SQL_MOVE_OUTPUT_SQLDA  1267

/* SQL_CLOSE_BEHAVIOR values.                  */

#define SQL_CC_NO_RELEASE             0
#define SQL_CC_RELEASE                1
#define SQL_CC_DEFAULT                SQL_CC_NO_RELEASE

/* CLI attribute/option values */
#define SQL_FALSE               0
#define SQL_TRUE                1

/* Options for SQL_CURSOR_HOLD */
#define SQL_CURSOR_HOLD_ON        1
#define SQL_CURSOR_HOLD_OFF       0
#define SQL_CURSOR_HOLD_DEFAULT   SQL_CURSOR_HOLD_ON


/* Options for SQL_NODESCRIBE_INPUT/SQL_NODESCRIBE_OUTPUT */
#define SQL_NODESCRIBE_ON          1
#define SQL_NODESCRIBE_OFF         0
#define SQL_NODESCRIBE_DEFAULT     SQL_NODESCRIBE_OFF

/* SQL_QUERY_TIMEOUT options */
#define SQL_QUERY_TIMEOUT_DEFAULT  0

/* SQL_MAX_ROWS options */
#define SQL_MAX_ROWS_DEFAULT       0

/* SQL_NOSCAN options */
#define SQL_NOSCAN_OFF             0
#define SQL_NOSCAN_ON              1
#define SQL_NOSCAN_DEFAULT         SQL_NOSCAN_OFF

/* SQL_MAX_LENGTH options */
#define SQL_MAX_LENGTH_DEFAULT     0

/* SQL_ASYNC_ENABLE options */
#define SQL_ASYNC_ENABLE_OFF       0
#define SQL_ASYNC_ENABLE_ON        1
#define SQL_ASYNC_ENABLE_DEFAULT   SQL_ASYNC_ENABLE_OFF

/* SQL_BIND_TYPE options */
#define SQL_BIND_BY_COLUMN         0
#define SQL_BIND_TYPE_DEFAULT      SQL_BIND_BY_COLUMN

/* SQL_CONCURRENCY options */
#define SQL_CONCUR_READ_ONLY       1
#define SQL_CONCUR_LOCK            2
#define SQL_CONCUR_ROWVER          3
#define SQL_CONCUR_VALUES          4
#define SQL_CONCUR_DEFAULT         SQL_CONCUR_READ_ONLY

/* SQL_CURSOR_TYPE options */
#define SQL_CURSOR_FORWARD_ONLY    0
#define SQL_CURSOR_KEYSET_DRIVEN   1
#define SQL_CURSOR_DYNAMIC         2
#define SQL_CURSOR_STATIC          3
#define SQL_CURSOR_TYPE_DEFAULT    SQL_CURSOR_FORWARD_ONLY

/* SQL_ROWSET_SIZE options */
#define SQL_ROWSET_SIZE_DEFAULT    1

/* SQL_KEYSET_SIZE options */
#define SQL_KEYSET_SIZE_DEFAULT    0

/* SQL_SIMULATE_CURSOR options */
#define SQL_SC_NON_UNIQUE          0
#define SQL_SC_TRY_UNIQUE          1
#define SQL_SC_UNIQUE              2

/* SQL_RETRIEVE_DATA options */
#define SQL_RD_OFF                 0
#define SQL_RD_ON                  1
#define SQL_RD_DEFAULT             SQL_RD_ON

/* SQL_USE_BOOKMARKS options */
#define SQL_UB_OFF                 0
#define SQL_UB_ON                  1
#define SQL_UB_DEFAULT             SQL_UB_OFF

/* Options for SQLSetConnectOption/SQLGetConnectOption */
#define SQL_ACCESS_MODE              101
#define SQL_AUTOCOMMIT               102
#define SQL_LOGIN_TIMEOUT            103
#define SQL_OPT_TRACE                104
#define SQL_OPT_TRACEFILE            105
#define SQL_TRANSLATE_DLL            106
#define SQL_TRANSLATE_OPTION         107
#define SQL_TXN_ISOLATION            108
#define SQL_CURRENT_QUALIFIER        109
#define SQL_ODBC_CURSORS             110
#define SQL_QUIET_MODE               111
#define SQL_PACKET_SIZE              112
#define SQL_CONNECT_OPT_DRVR_START   1000

/* Options for SQLGetConnectOption/SQLSetConnectOption extensions */
#define SQL_WCHARTYPE                1252
#define SQL_LONGDATA_COMPAT          1253
#define SQL_CURRENT_SCHEMA           1254
#define SQL_DB2EXPLAIN               1258
#define SQL_DB2ESTIMATE              1259
#define SQL_PARAMOPT_ATOMIC          1260
#define SQL_STMTTXN_ISOLATION        1261
#define SQL_MAXCONN                  1262

/* Options for SQLSetConnectOption, SQLSetEnvAttr */
#define SQL_CONNECTTYPE              1255
#define SQL_SYNC_POINT               1256
#define SQL_MINMEMORY_USAGE          1263

/* Options for SQL_LONGDATA_COMPAT */
#define SQL_LD_COMPAT_YES            1
#define SQL_LD_COMPAT_NO             0
#define SQL_LD_COMPAT_DEFAULT        SQL_LD_COMPAT_NO

/*
 *  Options for SQL_PARAMOPT_ATOMIC
 */

#define SQL_ATOMIC_YES               1
#define SQL_ATOMIC_NO                0
#define SQL_ATOMIC_DEFAULT           SQL_ATOMIC_YES

/* Options for SQL_CONNECT_TYPE */
#define SQL_CONCURRENT_TRANS         1
#define SQL_COORDINATED_TRANS        2
#define SQL_CONNECTTYPE_DEFAULT      SQL_CONCURRENT_TRANS

/* Options for SQL_SYNCPOINT */
#define SQL_ONEPHASE                 1
#define SQL_TWOPHASE                 2
#define SQL_SYNCPOINT_DEFAULT        SQL_ONEPHASE

/* Options for SQL_DB2ESTIMATE */
#define SQL_DB2ESTIMATE_ON           1
#define SQL_DB2ESTIMATE_OFF          0
#define SQL_DB2ESTIMATE_DEFAULT      SQL_DB2ESTIMATE_OFF

/* Options for SQL_DB2EXPLAIN */
#define SQL_DB2EXPLAIN_OFF              0x00000000L
#define SQL_DB2EXPLAIN_SNAPSHOT_ON      0x00000001L
#define SQL_DB2EXPLAIN_MODE_ON          0x00000002L
#define SQL_DB2EXPLAIN_SNAPSHOT_MODE_ON SQL_DB2EXPLAIN_SNAPSHOT_ON+SQL_DB2EXPLAIN_MODE_ON
#define SQL_DB2EXPLAIN_ON               SQL_DB2EXPLAIN_SNAPSHOT_ON
#define SQL_DB2EXPLAIN_DEFAULT          SQL_DB2EXPLAIN_OFF

/* Options for SQL_WCHARTYPE
 * Note that you can only specify SQL_WCHARTYPE_CONVERT if you have an
 * external compile flag SQL_WCHART_CONVERT defined
 */
#ifdef SQL_WCHART_CONVERT
#define SQL_WCHARTYPE_CONVERT        1
#endif
#define SQL_WCHARTYPE_NOCONVERT      0
#define SQL_WCHARTYPE_DEFAULT        SQL_WCHARTYPE_NOCONVERT

/* SQL_ACCESS_MODE options */
#define SQL_MODE_READ_WRITE          0
#define SQL_MODE_READ_ONLY           1
#define SQL_MODE_DEFAULT             SQL_MODE_READ_WRITE

/* SQL_AUTOCOMMIT options */
#define SQL_AUTOCOMMIT_OFF           0
#define SQL_AUTOCOMMIT_ON            1
#define SQL_AUTOCOMMIT_DEFAULT       SQL_AUTOCOMMIT_ON

/* SQL_LOGIN_TIMEOUT options */
#define SQL_LOGIN_TIMEOUT_DEFAULT    0

/* Column types and scopes in SQLSpecialColumns */
#define SQL_BEST_ROWID               1
#define SQL_ROWVER                   2

#define SQL_SCOPE_CURROW             0
#define SQL_SCOPE_TRANSACTION        1
#define SQL_SCOPE_SESSION            2

/* Defines for SQLStatistics */
#define SQL_INDEX_UNIQUE             0
#define SQL_INDEX_ALL                1

#define SQL_QUICK                    0
#define SQL_ENSURE                   1

/* Defines for SQLStatistics (returned in the result set) */
#define SQL_TABLE_STAT               0
#define SQL_INDEX_CLUSTERED          1
#define SQL_INDEX_HASHED             2
#define SQL_INDEX_OTHER              3

/* Defines for SQLSpecialColumns (returned in the result set) */
#define SQL_PC_UNKNOWN               0
#define SQL_PC_NOT_PSEUDO            1
#define SQL_PC_PSEUDO                2

/* SQLDataSources "fDirection" values, also used on SQLExtendedFetch() */
/* See sqlext.h for additional SQLExtendedFetch fetch direction defines */
#define  SQL_FETCH_NEXT              1
#define  SQL_FETCH_FIRST             2


/*
 * Environment attributes; note SQL_CONNECTTYPE, SQL_SYNC_POINT are also
 * environment attributes that are settable at the connection level
 */
#define SQL_ATTR_OUTPUT_NTS          10001


/*  LOB file reference options */
#ifndef SQL_H_SQL                     /* if sql.h is not included, then...  */
#define SQL_FILE_READ              2  /* Input file to read from            */
#define SQL_FILE_CREATE            8  /* Output file - new file to be       */
                                      /* created                            */
#define SQL_FILE_OVERWRITE        16  /* Output file - overwrite existing   */
                                      /* file or create a new file if it    */
                                      /* doesn't exist                      */
#define SQL_FILE_APPEND           32  /* Output file - append to an         */
                                      /* existing file or create a new file */
                                      /* if it doesn't exist                */
#endif

/*
 *  Source of string for SQLGetLength(), SQLGetPosition(),
 *  and SQLGetSubstring().
 */
#define SQL_FROM_LOCATOR           2
#define SQL_FROM_LITERAL           3



/*
 *  Function definitions of APIs in both X/Open CLI and ODBC
 */

SQLRETURN SQL_API_FN  SQLColumns       (SQLHSTMT          hstmt,
                                        SQLCHAR     FAR   *szCatalogName,
                                        SQLSMALLINT       cbCatalogName,
                                        SQLCHAR     FAR   *szSchemaName,
                                        SQLSMALLINT       cbSchemaName,
                                        SQLCHAR     FAR   *szTableName,
                                        SQLSMALLINT       cbTableName,
                                        SQLCHAR     FAR   *szColumnName,
                                        SQLSMALLINT       cbColumnName);

SQLRETURN SQL_API_FN  SQLDataSources   (SQLHENV           henv,
                                        SQLUSMALLINT      fDirection,
                                        SQLCHAR     FAR   *szDSN,
                                        SQLSMALLINT       cbDSNMax,
                                        SQLSMALLINT FAR   *pcbDSN,
                                        SQLCHAR     FAR   *szDescription,
                                        SQLSMALLINT       cbDescriptionMax,
                                        SQLSMALLINT FAR   *pcbDescription);

SQLRETURN SQL_API_FN  SQLGetConnectOption (
                                        SQLHDBC           hdbc,
                                        SQLUSMALLINT      fOption,
                                        SQLPOINTER        pvParam);

SQLRETURN SQL_API_FN  SQLGetFunctions  (SQLHDBC           hdbc,
                                        SQLUSMALLINT      fFunction,
                                        SQLUSMALLINT FAR  *pfExists);

SQLRETURN SQL_API_FN  SQLGetInfo       (SQLHDBC           hdbc,
                                        SQLUSMALLINT      fInfoType,
                                        SQLPOINTER        rgbInfoValue,
                                        SQLSMALLINT       cbInfoValueMax,
                                        SQLSMALLINT FAR   *pcbInfoValue);

SQLRETURN SQL_API_FN  SQLGetStmtOption (SQLHSTMT          hstmt,
                                        SQLUSMALLINT      fOption,
                                        SQLPOINTER        pvParam);

SQLRETURN SQL_API_FN  SQLGetTypeInfo   (SQLHSTMT          hstmt,
                                        SQLSMALLINT       fSqlType);

SQLRETURN SQL_API_FN  SQLParamData     (SQLHSTMT          hstmt,
                                        SQLPOINTER  FAR   *prgbValue);

SQLRETURN SQL_API_FN  SQLPutData       (SQLHSTMT          hstmt,
                                        SQLPOINTER        rgbValue,
                                        SQLINTEGER        cbValue);

SQLRETURN SQL_API_FN  SQLSetConnectOption(
                                        SQLHDBC           hdbc,
                                        SQLUSMALLINT      fOption,
                                        SQLUINTEGER       vParam);

SQLRETURN SQL_API_FN  SQLSetStmtOption (SQLHSTMT          hstmt,
                                        SQLUSMALLINT      fOption,
                                        SQLUINTEGER       vParam);

SQLRETURN SQL_API_FN  SQLSpecialColumns(SQLHSTMT          hstmt,
                                        SQLUSMALLINT      fColType,
                                        SQLCHAR     FAR   *szCatalogName,
                                        SQLSMALLINT       cbCatalogName,
                                        SQLCHAR     FAR   *szSchemaName,
                                        SQLSMALLINT       cbSchemaName,
                                        SQLCHAR     FAR   *szTableName,
                                        SQLSMALLINT       cbTableName,
                                        SQLUSMALLINT      fScope,
                                        SQLUSMALLINT      fNullable);

SQLRETURN SQL_API_FN  SQLStatistics    (SQLHSTMT          hstmt,
                                        SQLCHAR     FAR   *szCatalogName,
                                        SQLSMALLINT       cbCatalogName,
                                        SQLCHAR     FAR   *szSchemaName,
                                        SQLSMALLINT       cbSchemaName,
                                        SQLCHAR     FAR   *szTableName,
                                        SQLSMALLINT       cbTableName,
                                        SQLUSMALLINT      fUnique,
                                        SQLUSMALLINT      fAccuracy);

SQLRETURN SQL_API_FN  SQLTables        (SQLHSTMT          hstmt,
                                        SQLCHAR     FAR   *szCatalogName,
                                        SQLSMALLINT       cbCatalogName,
                                        SQLCHAR     FAR   *szSchemaName,
                                        SQLSMALLINT       cbSchemaName,
                                        SQLCHAR     FAR   *szTableName,
                                        SQLSMALLINT       cbTableName,
                                        SQLCHAR     FAR   *szTableType,
                                        SQLSMALLINT       cbTableType);


/*
 * DB2 specific CLI APIs
 */

SQLRETURN SQL_API_FN SQLBindFileToCol  (SQLHSTMT          hstmt,
                                        SQLUSMALLINT      icol,
                                        SQLCHAR     FAR   *FileName,
                                        SQLSMALLINT FAR   *FileNameLength,
                                        SQLUINTEGER FAR   *FileOptions,
                                        SQLSMALLINT       MaxFileNameLength,
                                        SQLINTEGER  FAR   *StringLength,
                                        SQLINTEGER  FAR   *IndicatorValue);

SQLRETURN SQL_API_FN SQLBindFileToParam(SQLHSTMT          hstmt,
                                        SQLUSMALLINT      ipar,
                                        SQLSMALLINT       fSqlType,
                                        SQLCHAR     FAR   *FileName,
                                        SQLSMALLINT FAR   *FileNameLength,
                                        SQLUINTEGER FAR   *FileOptions,
                                        SQLSMALLINT       MaxFileNameLength,
                                        SQLINTEGER  FAR   *IndicatorValue);

SQLRETURN SQL_API_FN SQLGetLength      (SQLHSTMT          hstmt,
                                        SQLSMALLINT       LocatorCType,
                                        SQLINTEGER        Locator,
                                        SQLINTEGER  FAR   *StringLength,
                                        SQLINTEGER  FAR   *IndicatorValue);

SQLRETURN SQL_API_FN SQLGetPosition    (SQLHSTMT          hstmt,
                                        SQLSMALLINT       LocatorCType,
                                        SQLINTEGER        SourceLocator,
                                        SQLINTEGER        SearchLocator,
                                        SQLCHAR     FAR   *SearchLiteral,
                                        SQLINTEGER        SearchLiteralLength,
                                        SQLUINTEGER       FromPosition,
                                        SQLUINTEGER FAR   *LocatedAt,
                                        SQLINTEGER  FAR   *IndicatorValue);


SQLRETURN SQL_API_FN SQLGetSQLCA       (SQLHENV           henv,
                                        SQLHDBC           hdbc,
                                        SQLHSTMT          hstmt,
                                        struct sqlca FAR  *pSqlca );

SQLRETURN SQL_API_FN SQLGetSubString   (SQLHSTMT          hstmt,
                                        SQLSMALLINT       LocatorCType,
                                        SQLINTEGER        SourceLocator,
                                        SQLUINTEGER       FromPosition,
                                        SQLUINTEGER       ForLength,
                                        SQLSMALLINT       TargetCType,
                                        SQLPOINTER        rgbValue,
                                        SQLINTEGER        cbValueMax,
                                        SQLINTEGER  FAR   *StringLength,
                                        SQLINTEGER  FAR   *IndicatorValue);

SQLRETURN SQL_API_FN SQLSetColAttributes (SQLHSTMT        hstmt,
                                        SQLUSMALLINT      icol,
                                        SQLCHAR     FAR   *pszColName,
                                        SQLSMALLINT       cbColName,
                                        SQLSMALLINT       fSQLType,
                                        SQLUINTEGER       cbColDef,
                                        SQLSMALLINT       ibScale,
                                        SQLSMALLINT       fNullable);

/*
 *  Set active connection API, for use in conjunction with embedded
 *  SQL programming only.
 */
SQLRETURN SQL_API_FN SQLSetConnection  (SQLHDBC           hdbc);

/*
 * APIs defined only by X/Open CLI
 */

SQLRETURN SQL_API_FN SQLGetEnvAttr     (SQLHENV           henv,
                                        SQLINTEGER        Attribute,
                                        SQLPOINTER        Value,
                                        SQLINTEGER        BufferLength,
                                        SQLINTEGER  FAR   *StringLength);

SQLRETURN SQL_API_FN SQLSetEnvAttr     (SQLHENV           henv,
                                        SQLINTEGER        Attribute,
                                        SQLPOINTER        Value,
                                        SQLINTEGER        StringLength);




#ifdef __cplusplus
}
#endif

/*
 * Include ODBC Version 2.50 header files for ODBC Level 1 and Level 2
 * functions that are not specified in the X/Open Call Level Interface.
 * This is included with permission from Microsoft.
 * Do not modify (i.e. must not add, remove, rearrange) any part of the
 * contents of sqlext.h
 * Note: SQLBrowseConnect(), SQLDescribeParam(), SQLDrivers, and SQLSetPos()
 *       in sqlext.h are not supported by the current version of DB2 CLI.
 */
#ifndef __SQL
#define __SQL
#define ODBCVER 0x0250
#endif
#include "sqlext.h"

#endif /* SQL_H_SQLCLI1 */
,
 kꘋ $ $         ˸5˸5͸5         3       ./usr/lpp/db2_02_01/include/sqlutil.h  .                    $          /******************************************************************************
** 
** Source File Name: SQLUTIL
** 
** (C) COPYRIGHT International Business Machines Corp. 1987, 1995
** All Rights Reserved
** Licensed Materials - Property of IBM
** 
** US Government Users Restricted Rights - Use, duplication or
** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
** 
** Function = Include File defining:
**              Utility / Configuration Commands - Constants
**              Utility / Configuration Commands - Data Structures
**              Utility / Configuration Commands - Function Prototypes
**              Utility / Configuration Commands - Labels for SQLCODES
** 
** Operating System:AIX
** 
*******************************************************************************/
#ifndef SQL_H_SQLUTIL
#define SQL_H_SQLUTIL

#ifdef __cplusplus
extern "C" {
#endif

/* Note: _SQLOLDCHAR defaults to 'char'.  See sqlsystm.h for details.         */

#include "sql.h"                       /* Includes sqlca.h & sqlsystm.h */

#pragma options align=power

/* Interface Parameters/Structures/Return Codes                               */

/* Parameters for Rollforward caller action                                   */
#define SQLUM_ROLLFWD          1       /* Roll forward to requested point     */
#define SQLUM_STOP             2       /* End roll-forward recovery           */
#define SQLUM_ROLLFWD_STOP     3       /* Roll forward to requested point     */
                                       /* and end roll-forward recovery       */
#define SQLUM_QUERY            4       /* Query nextArcFile, firstDeleteArc,  */
                                       /* lastDeleteArc, lastCommitTime       */
#define SQLUM_PARM_CHECK       10      /* Parameter check                     */
#define SQLUM_LOADREC_CONTINUE 11      /* Continue load recovery.             */
#define SQLUM_LOADREC_TERMINATE 12     /* Terminate load recovery.            */
#define SQLUM_LOADREC_DEVICE_TERMINATE 13 /* Terminate device.Caller action   */
                                       /* codes 31 - 35 reserved for          */
                                       /* internal use.                       */

/* Constants used for Rollforward                                             */
#define SQLUM_INFINITY_TIMESTAMP "9999-12-31-23.59.59.999999" /* Roll         */
                                       /* forward until STOP specified        */
#define SQLUM_ARCHIVE_FILE_LEN 12      /* Length of Archive File name         */
#define SQLUM_TIMESTAMP_LEN    26      /* Length of ISO format Timestamp      */

/* Rollforward connect mode                                                   */
#define SQLUM_OFFLINE          0x0     /* Offline rollforward mode            */
#define SQLUM_ONLINE           0x1     /* Online rollforward mode             */

/* Backup backup mode                                                         */
#define SQLUB_OFFLINE          0x0     /* Offline backup mode                 */
#define SQLUB_ONLINE           0x1     /* Online backup mode                  */

/* Backup type                                                                */
#define SQLUB_FULL             0
#define SQLUB_TABLESPACE       3

/* Backup calling action values                                               */
#define SQLUB_BACKUP           0       /* initial call                        */
#define SQLUB_CONTINUE         1       /* Subsequent call                     */
#define SQLUB_TERMINATE        2       /* Terminating call                    */
#define SQLUB_NOINTERRUPT      3       /* Initial call to run without         */
                                       /* prompting                           */
#define SQLUB_DEVICE_TERMINATE 9       /* End media device.                   */
#define SQLUB_PARM_CHECK       10      /* for parameter check only.           */

/* Restore mode                                                               */
#define SQLUD_ROLLFWD          0x0
#define SQLUD_NOROLLFWD        0x1

/* Restore calling action values                                              */
#define SQLUD_RESTORE          0       /* initial call                        */
#define SQLUD_CONTINUE         1       /* Subsequent call                     */
#define SQLUD_TERMINATE        2       /* Terminating call                    */
#define SQLUD_NOINTERRUPT      3       /* Initial call to run without         */
                                       /* prompting                           */
#define SQLUD_DEVICE_TERMINATE 9       /* End media device.                   */
#define SQLUD_PARM_CHECK       10      /* for parameter check only.           */
#define SQLUD_RESTORE_STORDEF  100     /* initial call, tablespace container  */
                                       /* redefinition requested              */
#define SQLUD_STORDEF_NOINTERRUPT 101  /* initial call, tablespace container  */
                                       /* redefinition requested without      */
                                       /* prompting                           */

/* Restore type                                                               */
#define SQLUD_FULL             0
#define SQLUD_ONLINE_TABLESPACE 3
#define SQLUD_TABLESPACE       4
#define SQLUD_HISTORY          5
/* The following are not supported in V2.1.0                                  */
#define SQLUD_TABLESPACE_TBL   6
#define SQLUD_HIST_TBLSPACE_TBL 7

/* Backup/Restore Definitions                                                 */
#define SQLU_ALIAS_SZ          8       /* length of database alias name       */
#define SQLU_USERID_LEN        8       /* length of userid                    */
#define SQLU_PWD_LEN           18      /* length of password                  */
#define SQLU_TIME_STAMP_LEN    14      /* length of the backup timestamp in   */
                                       /* yyyymmddhhmmss format               */

/* length of filename of backup image:                                        */
/* dbalias.type.db2instance.node.timestamp.seq                                */
#define SQLU_BACKUP_NAME_SZ    (SQLU_ALIAS_SZ+5+SQLU_USERID_LEN+5+SQLU_TIME_STAMP_LEN+4)

/* length of directory where backup file will reside:dir - '/' - filename     */
#define SQLU_BACKUP_DIR_SZ     (1023-1-SQLU_BACKUP_NAME_SZ)

/* Parameters for Backup/Restore old api's                                    */
#define SQLU_NSD_ID            '0'     /* User exit used, not SD interface    */

/* Media type for old api's                                                   */
#define SQLUB_MEDIA_TARGET     0x0
#define SQLUB_ADSM             0x1
#define SQLUB_OTHER            0x2

/* Old OS/2 Backup/restore media type values                                  */
#define SQLUD_MEDIA_SRC        0x0
#define SQLUD_ADSM             0x1
#define SQLUD_OTHER            0x2

/* Parameters for SQLUHPRN force option                                       */
#define SQLUH_NO_FORCE         0
#define SQLUH_FORCE            1

/* Parameters for SQLUHOPS caller action                                      */
#define SQLUH_LIST_BACKUP      0
#define SQLUH_LIST_HISTORY     1

/* History File structure sizes                                               */
#define SQLUH_OP_SZ            1
#define SQLUH_OBJ_SZ           1
#define SQLUH_OBJPART_SZ       17
#define SQLUH_OPTYPE_SZ        1
#define SQLUH_DEVTYPE_SZ       1
#define SQLUH_FIRSTLOG_SZ      12
#define SQLUH_LASTLOG_SZ       12
#define SQLUH_BACKID_SZ        14
#define SQLUH_TCREATE_SZ       8
#define SQLUH_TNAME_SZ         18
#define SQLUH_NUMTABLESPACE_SZ 5
#define SQLUH_LOC_SZ           255
#define SQLUH_COMMENT_SZ       30
#define SQLUH_TABLESPACENAME_SZ 18

/* Parameters for RUNSTATS                                                    */
#define SQL_STATS_TABLE           'T'  /* TABLEOPT = Table w/o Indexes        */
#define SQL_STATS_BOTH            'B'  /* TABLEOPT = Table and Indexes        */
#define SQL_STATS_INDEX           'I'  /* TABLEOPT = Indexes w/o Table        */
#define SQL_STATS_EXTTABLE_ONLY   'D'  /* TABLEOPT = Table and dist stats     */
#define SQL_STATS_EXTTABLE_INDEX  'E'  /* TABLEOPT = Table and dist stats     */
                                       /* and basic indexes                   */
#define SQL_STATS_EXTINDEX_ONLY   'X'  /* TABLEOPT = Ext stats for indexes    */
                                       /* only                                */
#define SQL_STATS_EXTINDEX_TABLE  'Y'  /* TABLEOPT = Ext stats for indexes    */
                                       /* and basic table stats               */
#define SQL_STATS_ALL             'A'  /* TABLEOPT = Ext stats for indexes    */
                                       /* and table with dist stats           */
#define SQL_STATS_REF             'R'  /* SHAREOPT = Reference                */
#define SQL_STATS_CHG             'C'  /* SHAREOPT = Change                   */

#define SQLU_STATS_NONE           ' '  /* TABLEOPT - no statistics are to be  */
                                       /* gathered - Load only                */

/* Parameters for selection method in sqldcol                                 */
#define SQL_METH_N             78      /* Names                               */
#define SQL_METH_P             80      /* Positional                          */
#define SQL_METH_D             68      /* Default                             */
#define SQL_METH_L             76      /* Locations                           */

/* File Types for Import/Export                                               */
#define SQL_IXF                "IXF"
#define SQL_WSF                "WSF"
#define SQL_DEL                "DEL"
#define SQL_ASC                "ASC"
#define SQL_DB2CS              "DB2CS" /* load/unload                         */

/* Client Communication Protocols                                             */
#define SQLF_PROTOCOL_TCPIP    "TCPIP"
#define SQLF_PROTOCOL_APPC     "APPC"

/* Import/Export/Load/Unload calling action values                            */
#define SQLU_INITIAL           0x0     /* Initial call                        */
#define SQLU_CONTINUE          0x1     /* Subsequent call                     */
#define SQLU_TERMINATE         0x2     /* Terminating call                    */
#define SQLU_NOINTERRUPT       0x3     /* Initial call - Load/Unload only     */
#define SQLU_ABORT             0x4     /* Abort call - Load only              */
#define SQLU_RESTART           0x5     /* Restart call - Load only            */
#define SQLU_DEVICE_TERMINATE  0x9     /* Subsequent call - Load/Unload only  */

/* Actions for quiesce tablespaces for table                                  */
#define SQLU_QUIESCEMODE_SHARE              0
#define SQLU_QUIESCEMODE_INTENT_UPDATE      1
#define SQLU_QUIESCEMODE_EXCLUSIVE          2
#define SQLU_QUIESCEMODE_RESET              9
#define SQLU_QUIESCEMODE_RESET_OWNED        10

/* Equates for Configuration Utilities                                        */

/* Token equates for SQLFupd structure for Kernel config file                 */
#define SQLF_KTN_RQRIOBLK      1
#define SQLF_KTN_NUMDB         6
#define SQLF_KTN_NNAME         7
#define SQLF_KTN_MAXAGENTS     12
#define SQLF_KTN_MAXCAGENTS    13
#define SQLF_KTN_ASLHEAPSZ     15
#define SQLF_KTN_SQLSTMTSZ     17
#define SQLF_KTN_BACKBUFSZ     18
#define SQLF_KTN_RESTBUFSZ     19
#define SQLF_KTN_INDEXREC      20
#define SQLF_KTN_SHEAPTHRES    21
#define SQLF_KTN_MAXDARI       80
#define SQLF_KTN_KEEPDARI      81
#define SQLF_KTN_SVCENAME      24
#define SQLF_KTN_TPNAME        25
#define SQLF_KTN_AGENTPRI      26
#define SQLF_KTN_DFTDBPATH     27

/* tokens for new Version 2.1 parameters                                      */
#define SQLF_KTN_DFT_ACCOUNT_STR  28

/* You may manipulate the bits of SQLF_KTN_DFT_MONSWITCHES or you can enable  */
/* disable, or query the current setting through the individual tokens        */
#define SQLF_KTN_DFT_MONSWITCHES  29
#define SQLF_KTN_DFT_MON_UOW      30   /* Bit 1 of SQLF_KTN_DFT_MONSWITCHES   */
#define SQLF_KTN_DFT_MON_STMT     31   /* Bit 2 of SQLF_KTN_DFT_MONSWITCHES   */
#define SQLF_KTN_DFT_MON_TABLE    32   /* Bit 3 of SQLF_KTN_DFT_MONSWITCHES   */
#define SQLF_KTN_DFT_MON_BUFPOOL  33   /* Bit 4 of SQLF_KTN_DFT_MONSWITCHES   */
#define SQLF_KTN_DFT_MON_LOCK     34   /* Bit 5 of SQLF_KTN_DFT_MONSWITCHES   */
#define SQLF_KTN_DFT_MON_SORT     35   /* Bit 6 of SQLF_KTN_DFT_MONSWITCHES   */

#define SQLF_KTN_SYSADM_GROUP     39
#define SQLF_KTN_DIR_CACHE        40
#define SQLF_KTN_DRDA_HEAP_SZ     41
#define SQLF_KTN_CPUSPEED         42
#define SQLF_KTN_MIN_PRIV_MEM     43
#define SQLF_KTN_PRIV_MEM_THRESH  44
#define SQLF_KTN_MAXTOTFILOP      45
#define SQLF_KTN_FILESERVER       47
#define SQLF_KTN_OBJECTNAME       48
#define SQLF_KTN_QUERY_HEAP_SZ    49

#define SQLF_KTN_MAX_IDLEAGENTS   60
#define SQLF_KTN_AGENT_STACK_SZ   61
#define SQLF_KTN_SYSMAINT_GROUP   62
#define SQLF_KTN_SYSCTRL_GROUP    63

#define SQLF_KTN_DIAGLEVEL        64
#define SQLF_KTN_DIAGPATH         65

#define SQLF_KTN_TP_MON_NAME      66
#define SQLF_KTN_TM_DATABASE      67
#define SQLF_KTN_RESYNC_INTERVAL  68
#define SQLF_KTN_UDF_MEM_SZ       69

#define SQLF_KTN_IPX_SOCKET       71
#define SQLF_KTN_DOS_RQRIOBLK     72

#define SQLF_KTN_DIR_TYPE         73   /* token for directory services        */
#define SQLF_KTN_DIR_PATH_NAME    74   /* token for directory services        */
#define SQLF_KTN_DIR_OBJ_NAME     75   /* token for directory services        */
#define SQLF_KTN_ROUTE_OBJ_NAME   76   /* token for directory services        */
#define SQLF_KTN_DFT_CLIENT_COMM  77   /* token for directory services        */
#define SQLF_KTN_AUTHENTICATION   78
#define SQLF_KTN_MON_HEAP_SZ      79

/* tokens for syncpoint manager                                               */
#define SQLF_KTN_SPM_LOG_FILE_SZ  90
#define SQLF_KTN_SPM_MAX_RESYNC   91
#define SQLF_KTN_SPM_NAME         92

/* tokens for adsm                                                            */
#define SQLF_KTN_ADSM_PASSWORD    93
#define SQLF_KTN_ADSM_NODENAME    94
#define SQLF_KTN_ADSM_OWNER       95

/* equates for diretory type                                                  */
#define SQLF_DIRTYPE_NONE         0
#define SQLF_DIRTYPE_DCE          1

/* tokens for internal parameters                                             */
#define SQLF_KTN_NODETYPE         100
#define SQLF_KTN_RELEASE          101
#define SQLF_KTN_NOTOKEN          200

/* Nodetype equates                                                           */
#define SQLF_NT_STANDALONE        0
#define SQLF_NT_SERVER            1
#define SQLF_NT_REQUESTOR         2
#define SQLF_NT_STAND_REQ         3

/******************************************************************************
** Defines for Database Monitor Switches - SQLF_KTN_DFT_MONSWITCHES
** 
** The following meanings apply when the bits are set on.
** 
** SQLF_ENABLE_MON_UOW     -
** SQLF_ENABLE_MON_STMT    -
** SQLF_ENABLE_MON_TABLE   -
** SQLF_ENABLE_MON_BUFPOOL -
** SQLF_ENABLE_MON_LOCK    -
** SQLF_ENABLE_MON_SORT    -
*******************************************************************************/

#define SQLF_ENABLE_MON_UOW       0x1  /* xxxx xxxx xxxx xxx1                 */
#define SQLF_ENABLE_MON_STMT      0x2  /* xxxx xxxx xxxx xx1x                 */
#define SQLF_ENABLE_MON_TABLE     0x4  /* xxxx xxxx xxxx x1xx                 */
#define SQLF_ENABLE_MON_BUFPOOL   0x8  /* xxxx xxxx xxxx 1xxx                 */
#define SQLF_ENABLE_MON_LOCK      0x10 /* xxxx xxxx xxx1 xxxx                 */
#define SQLF_ENABLE_MON_SORT      0x20 /* xxxx xxxx xx1x xxxx                 */

/* Token equates for SQLFupd structure for DB config file                     */
#define SQLF_DBTN_LOCKLIST        1
#define SQLF_DBTN_BUFF_PAGE       90
#define SQLF_DBTN_MAXFILOP        3
#define SQLF_DBTN_SOFTMAX         5
#define SQLF_DBTN_MAXAPPLS        6
#define SQLF_DBTN_APPLHEAPSZ      51
#define SQLF_DBTN_DBHEAP          50
#define SQLF_DBTN_DLCHKTIME       9
#define SQLF_DBTN_SORT_HEAP       52
#define SQLF_DBTN_MAXLOCKS        15
#define SQLF_DBTN_LOGPRIMARY      16
#define SQLF_DBTN_LOGSECOND       17
#define SQLF_DBTN_LOGFILSIZ       18
#define SQLF_DBTN_STMTHEAP        53
#define SQLF_DBTN_NEWLOGPATH      20
#define SQLF_DBTN_DETS            21
#define SQLF_DBTN_COPY_PROTECT    22
#define SQLF_DBTN_LOG_RETAIN      23
#define SQLF_DBTN_USER_EXIT       24
#define SQLF_DBTN_AUTO_RESTART    25
#define SQLF_DBTN_INDEXREC        30
#define SQLF_DBTN_PCKCACHESZ      31
#define SQLF_DBTN_MINCOMMIT       32
#define SQLF_DBTN_LOGBUFSZ        33

/* tokens for new Version 2.1 parameters                                      */
#define SQLF_DBTN_LOCKTIMEOUT     34
#define SQLF_DBTN_INDEXSORT       35
#define SQLF_DBTN_NUM_FREQVALUES  36
#define SQLF_DBTN_NUM_IOCLEANERS  37
#define SQLF_DBTN_CHNGPGS_THRESH  38
#define SQLF_DBTN_NUM_IOSERVERS   39
#define SQLF_DBTN_DFT_PREFETCH_SZ 40
#define SQLF_DBTN_SEQDETECT       41
#define SQLF_DBTN_DFT_LOADREC_SES 42
#define SQLF_DBTN_REC_HIS_RETENTN 43
#define SQLF_DBTN_COLLATE_INFO    44
#define SQLF_DBTN_STAT_HEAP_SZ    45
#define SQLF_DBTN_DIR_OBJ_NAME    46   /* token for directory services        */
#define SQLF_DBTN_AVG_APPLS       47
#define SQLF_DBTN_NUM_QUANTILES   48
#define SQLF_DBTN_DFT_EXTENT_SZ   54
#define SQLF_DBTN_UTIL_HEAP_SZ    55
#define SQLF_DBTN_CATALOGCACHE_SZ 56
#define SQLF_DBTN_DFT_QUERYOPT    57

/* tokens for internal parameters                                             */
#define SQLF_DBTN_COUNTRY         100
#define SQLF_DBTN_CODEPAGE        101
#define SQLF_DBTN_RELEASE         102
#define SQLF_DBTN_LOGPATH         103
#define SQLF_DBTN_INTFLAGS        104
#define SQLF_DBTN_LOGHEAD         105
#define SQLF_DBTN_NEXTACTIVE      107
#define SQLF_DBTN_CONSISTENT      111
#define SQLF_DBTN_BACKUP_PENDING  112
#define SQLF_DBTN_ROLLFWD_PENDING 113
#define SQLF_DBTN_LOG_RETAIN_STATUS 114
#define SQLF_DBTN_USER_EXIT_STATUS 115
#define SQLF_DBTN_CODESET         120
#define SQLF_DBTN_TERRITORY       121
#define SQLF_DBTN_NUMSEGS         122
#define SQLF_DBTN_DATABASE_LEVEL  124
#define SQLF_DBTN_NOTOKEN         200

/* Index recreate type                                                        */
#define SQLF_INX_REC_SYSTEM       0
#define SQLF_INX_REC_REFERENCE    1
#define SQLF_INX_REC_RESTART      2

/* Special values for configuration defaults                                  */
#define SQLFDMCA                  -1   /* Default maxcagents                  */
#define SQLFDMXD                  -1   /* Default maxdari                     */
#define SQLFDAPR                  -1   /* Default agentpri                    */
#define SQLFMKPD                  0    /* keepdari - no                       */
#define SQLFXKPD                  1    /* keepdari - yes                      */

/******************************************************************************
** You may manipulate the bits of SQLF_DBTN_DETS and SQLF_DBTN_INTFLAGS
** or you can enable, disable, or query the current setting through
** the individual tokens.
** 
** Defines for: SQLF_DBTN_COPY_PROTECT    , SQLF_DBTN_LOG_RETAIN
**              SQLF_DBTN_USER_EXIT       , SQLF_DBTN_AUTO_RESTART
**              SQLF_DBTN_CONSISTENT      , SQLF_DBTN_BACKUP_PENDING
**              SQLF_DBTN_ROLLFWD_PENDING , SQLF_DBTN_LOG_RETAIN_STATUS
**              SQLF_DBTN_USER_EXIT_STATUS
*******************************************************************************/

#define SQLF_DISABLE              0
#define SQLF_ENABLE               1
#define SQLF_ROLLFWD_TABLESPACE   2    /* The third state of rollfwd_pending  */
/******************************************************************************
** Defines for Database Details - SQLF_DBTN_DETS
** 
** The following meanings apply when the bits are set on.
** 
** SQLF_COPY_PROTECT       - Database is copy protected.
** SQLF_ENABLE_LOG_RETAIN  - Next time database is started in normal
**                           conditions, the log files will be retained
**                           for the purpose of roll-forward recovery.
** SQLF_ENABLE_USER_EXIT   - Next time database is started in normal
**                           conditions, the user log exit will be enabled
**                           for the purpose of roll-forward recovery.
** SQLF_ENABLE_AUTO_RESTART- The RESTART DATABASE function will be
**                           invoked when needed.
*******************************************************************************/

#define SQLF_COPY_NOPROT          0x0  /* xxxx xxxx xxxx xxx0                 */
#define SQLF_COPY_PROTECT         0x1  /* xxxx xxxx xxxx xxx1                 */
#define SQLF_ENABLE_LOG_RETAIN    0x2  /* xxxx xxxx xxxx xx1x                 */
#define SQLF_ENABLE_USER_EXIT     0x4  /* xxxx xxxx xxxx x1xx                 */
#define SQLF_ENABLE_AUTO_RESTART  0x8  /* xxxx xxxx xxxx 1xxx                 */

/******************************************************************************
** Defines for Logging Flags    - SQLF_DBTN_INTFLAGS
** 
** The following meanings apply when the bits are set on.
** 
** SQLF_CONSISTENT      - Database is in a consistent state.
** SQLF_BACKUP_PENDING  - User is required to take a backup of the
**                        database before the system will allow the
**                        database to be opened for normal processing.
** SQLF_ROLLFWD_PENDING - User is required to roll forward the database
**                        before the system will allow the database to
**                        be opened for normal processing.
** SQLF_LOG_RETAIN      - Log files are retained so that a database can be
**                        rolled forward after it has been restored from
**                        a backup copy.
** SQLF_USER_EXIT       - User exit is taken when log files are filled and
**                        when log files are needed and not found.
** SQLF_TBS_ROLLFWD     - If the SQLF_ROLLFWD_PENDING bit is off, and this
**                        bit is on, then the tablespace needs to be
**                        rolled forward.
** 
*******************************************************************************/

#define SQLF_CONSISTENT           0x1  /* xxxx xxxx xxxx xxx1                 */
#define SQLF_BACKUP_PENDING       0x4  /* xxxx xxxx xxxx x1xx                 */
#define SQLF_ROLLFWD_PENDING      0x8  /* xxxx xxxx xxxx 1xxx                 */
#define SQLF_LOG_RETAIN           0x10 /* xxxx xxxx xxx1 xxxx                 */
#define SQLF_USER_EXIT            0x20 /* xxxx xxxx xx1x xxxx                 */
#define SQLF_TBS_ROLLFWD          0x40 /* xxxx xxxx x1xx xxxx                 */

#define SQL_TPNAME_SZ             64   /* length of tpname config parm        */

#define SQL_SPM_NAME_SZ           8    /* length of syncpoint manager name    */

#define SQL_LOGPATH_SZ            242  /* max length of log parms             */
#define SQL_LOGFILE_NAME_SZ       12   /* max length of log file name         */
#define SQL_DBPATH_SZ             215  /* max length of db path parm          */
#define SQL_FFDCPATH_SZ           215  /* max length of diagpath parm         */

/* LOAD and UNLOAD defines                                                    */
#define SQLU_LOAD_PHASE        'L'     /* restart at load phase               */
#define SQLU_BUILD_PHASE       'B'     /* restart at build phase              */
#define SQLU_DELETE_PHASE      'D'     /* restart at delete phase             */

SQL_STRUCTURE sqldcoln
{
   short           dcolnlen;
   char            *dcolnptr;
};

SQL_STRUCTURE sqldcol
{
   short           dcolmeth;
   short           dcolnum;
   struct sqldcoln dcolname[1];   /* actual size must be dcolnum              */
};

/* Structure for Pairs of Locations for ASC files                             */
SQL_STRUCTURE sqllocpair
{
   short           begin_loc;
   short           end_loc;
};

SQL_STRUCTURE sqlloctab
{
   struct sqllocpair locpair[1];  /* actual size must be dcolnum              */
};

/* Structures for Input and Output Data for Import and Export                 */

SQL_STRUCTURE sqluimpt_in
{
   unsigned long   sizeOfStruct;
   unsigned long   commitcnt;
   unsigned long   restartcnt;
};

SQL_STRUCTURE sqluimpt_out
{
   unsigned long   sizeOfStruct;
   unsigned long   rowsRead;
   unsigned long   rowsSkipped;
   unsigned long   rowsInserted;
   unsigned long   rowsUpdated;
   unsigned long   rowsRejected;
   unsigned long   rowsCommitted;
};

SQL_STRUCTURE sqluexpt_out
{
   unsigned long   sizeOfStruct;
   unsigned long   rowsExported;
};

#define SQLUIMPT_IN_SIZE       sizeof(struct sqluimpt_in)
#define SQLUIMPT_OUT_SIZE      sizeof(struct sqluimpt_out)
#define SQLUEXPT_OUT_SIZE      sizeof(struct sqluexpt_out)

/* Structures for Input and Output Data for Load and Unload                   */

SQL_STRUCTURE sqluload_in
{
   unsigned long   sizeOfStruct;
   unsigned long   savecnt;
   unsigned long   restartcnt;
   unsigned long   rowcnt;
   unsigned long   warningcnt;
   unsigned long   data_buffer_size;
   unsigned long   sort_buffer_size;
   unsigned short  hold_quiesce;
   char            restartphase;
   char            statsopt;
};

SQL_STRUCTURE sqluload_out
{
   unsigned long   sizeOfStruct;
   unsigned long   rowsRead;
   unsigned long   rowsSkipped;
   unsigned long   rowsLoaded;
   unsigned long   rowsRejected;
   unsigned long   rowsDeleted;
   unsigned long   rowsCommitted;
};

SQL_STRUCTURE sqluunld_in
{
   unsigned long   sizeOfStruct;
   unsigned long   data_buffer_size;
   unsigned long   sort_buffer_size;
   unsigned short  hold_quiesce;
   unsigned short  intent_update;
   unsigned short  serial_write;
   unsigned short  num_buffers;
   unsigned short  reorg_lobs;
   unsigned short  filler;
};

SQL_STRUCTURE sqluunld_out
{
   unsigned long   sizeOfStruct;
   unsigned long   rowsUnloaded;
};

#define SQLULOAD_IN_SIZE       sizeof(struct sqluload_in)
#define SQLULOAD_OUT_SIZE      sizeof(struct sqluload_out)
#define SQLUUNLD_IN_SIZE       sizeof(struct sqluunld_in)
#define SQLUUNLD_OUT_SIZE      sizeof(struct sqluunld_out)

/* Constants and Structures for the Asynchronous Read Log API                 */

#define SQLU_RLOG_READ         1       /* read the database log               */
#define SQLU_RLOG_READ_SINGLE  2       /* read a single log record            */
#define SQLU_RLOG_QUERY        3       /* query the database log              */

typedef union SQLU_LSN
{
   unsigned char   lsnChar[6];         /* 6 byte character representation     */
   unsigned short  lsnWord[3];         /* 6 byte short representation         */
} SQLU_LSN;

typedef SQL_STRUCTURE SQLU_RLOG_INFO
{
   SQLU_LSN        initialLSN;         /* initial lsn at first connect        */
   SQLU_LSN        firstReadLSN;       /* first lsn read on call              */
   SQLU_LSN        lastReadLSN;        /* last lsn read on call               */
   SQLU_LSN        curActiveLSN;       /* current active lsn                  */
   unsigned long   logRecsWritten;     /* number of log records returned      */
   unsigned long   logBytesWritten;    /* number of log bytes returned        */
} SQLU_RLOG_INFO;

/* Structures for Configuration Utility APIs.                                 */

SQL_STRUCTURE sqlfupd
{
   unsigned short  token;
   char            *ptrvalue;
};

/* Constants and structure used by sqlgadau and sqluadau.                     */
#define SQL_USER_AUTHORIZED                 1
#define SQL_USER_UNAUTHORIZED               0
#define SQL_AUTHORIZATION_SIZE_OLD          22
#define SQL_AUTHORIZATION_SIZE              34

SQL_STRUCTURE sql_authorizations
{
   short           sql_authorizations_len;
   short           sql_sysadm_auth;
   short           sql_dbadm_auth;
   short           sql_createtab_auth;
   short           sql_bindadd_auth;
   short           sql_connect_auth;
   short           sql_sysadm_grp_auth;
   short           sql_dbadm_grp_auth;
   short           sql_createtab_grp_auth;
   short           sql_bindadd_grp_auth;
   short           sql_connect_grp_auth;
   short           sql_sysctrl_auth;
   short           sql_sysctrl_grp_auth;
   short           sql_sysmaint_auth;
   short           sql_sysmaint_grp_auth;
   short           sql_create_not_fenc_auth;
   short           sql_create_not_fenc_grp_auth;
};

/* Constants and structure used for backup and restore                        */
#define SQLU_MAX_TBS_NAME_LEN     18
#define SQLU_DB_DIR_LEN           215
#define SQLU_SHR_LIB_LEN          255
#define SQLU_MEDIA_LOCATION_LEN   255
#define SQLU_APPLID_LEN           32
#define SQLU_MAX_SESSIONS         999

typedef SQL_STRUCTURE sqlu_tablespace_entry
{
   unsigned long   reserve_len;
   char            tablespace_entry[SQLU_MAX_TBS_NAME_LEN+1];
   char            filler[1];
} sqlu_tablespace_entry;

typedef SQL_STRUCTURE sqlu_tablespace_bkrst_list
{
   long            num_entry;
   struct sqlu_tablespace_entry *tablespace;
} sqlu_tablespace_bkrst_list;

typedef SQL_STRUCTURE sqlu_media_entry
{
   unsigned long   reserve_len;
   char            media_entry[SQLU_DB_DIR_LEN+1];
} sqlu_media_entry;

typedef SQL_STRUCTURE sqlu_vendor
{
   unsigned long   reserve_len1;
   char            shr_lib[SQLU_SHR_LIB_LEN+1];
   unsigned long   reserve_len2;
   char            filename[SQLU_SHR_LIB_LEN+1];
} sqlu_vendor;

typedef SQL_STRUCTURE sqlu_location_entry
{
   unsigned long   reserve_len;
   char            location_entry[SQLU_MEDIA_LOCATION_LEN+1];
} sqlu_location_entry;

#define SQLU_LOCAL_MEDIA       'L'     /* path/device                         */
#define SQLU_SERVER_LOCATION   'S'     /* remote file/device/named pipe       */
#define SQLU_CLIENT_LOCATION   'C'     /* local file/device/named pipe        */
#define SQLU_ADSM_MEDIA        'A'     /* ADSM                                */
#define SQLU_OTHER_MEDIA       'O'     /* vendor library                      */
#define SQLU_USER_EXIT         'U'     /* user exit                           */
#define SQLU_DISK_MEDIA        'D'     /* Generated only by vendors           */
#define SQLU_DISKETTE_MEDIA    'K'     /* Generated only by vendors           */
#define SQLU_TAPE_MEDIA        'T'     /* Generated only by vendors           */
#define SQLU_PIPE_MEDIA        'P'     /* Generated only by vendors           */

union sqlu_media_list_targets
{
   struct sqlu_media_entry        *media;      /* For media_type L - for      */
                                               /* BACKUP, RESTORE and LOAD    */
                                               /* copytarget, workdirectory,  */
                                               /* lobpaths, IMPORT and        */
                                               /* EXPORT lobpaths             */
   struct sqlu_vendor             *vendor;     /* For media_type O            */
   struct sqlu_location_entry     *location;   /* For media_type S - for      */
                                               /* LOAD and LOAD recovery      */
                                               /* For media type C - for      */
                                               /* EXPORT lobfile              */
};

typedef SQL_STRUCTURE sqlu_media_list
{
   char            media_type;
   char            filler[3];
   long            sessions;
   union sqlu_media_list_targets target;
} sqlu_media_list;

SQL_STRUCTURE sqluhtsp
{
   char            tablespace_name[SQLUH_TABLESPACENAME_SZ+1]; /* tablespace  */
                               /* name                                        */
   char            filler;
};

SQL_STRUCTURE sqluhinfo
{
   char      sqluhinfoid[8];                   /* Eye catcher = 'SQLUHINF'    */
   long      sqluhinfobc;                      /* SQLUHINFO  in bytes=(   )   */
   short     sqln;                             /* Number of tablespace        */
                                               /* elements                    */
   short     sqld;                             /* # of used tablespace        */
                                               /* elements                    */
   char      operation[SQLUH_OP_SZ+1];         /* operation                   */
   char      object[SQLUH_OBJ_SZ+1];           /* object                      */
   char      object_part[SQLUH_OBJPART_SZ+1];  /* object part                 */
   char      optype[SQLUH_OPTYPE_SZ+1];        /* optype                      */
   char      device_type[SQLUH_DEVTYPE_SZ+1];  /* device type                 */
   char      first_log[SQLUH_FIRSTLOG_SZ+1];   /* first log                   */
   char      last_log[SQLUH_LASTLOG_SZ+1];     /* last log                    */
   char      backup_id[SQLUH_BACKID_SZ+1];     /* backup id                   */
   char      table_creator[SQLUH_TCREATE_SZ+1]; /* table creator              */
   char      table_name[SQLUH_TNAME_SZ+1];     /* table name                  */
   char      num_of_tablespaces[SQLUH_NUMTABLESPACE_SZ+1]; /* # of            */
                                               /* tablespaces                 */
   char      location[SQLUH_LOC_SZ+1];         /* location                    */
   char      comment[SQLUH_COMMENT_SZ+1];      /* comment                     */
   struct sqluhtsp tablespace[1];
};

/* Macro for size of sqluhinfo                                                */
#define   SQLUHINFOSIZE(n) \
(sizeof(struct sqluhinfo) + (n-1)*sizeof(struct sqluhtsp))

/* Definitions needed for the sqlb api calls                                  */
/*                                                                            */
/* nb: 'tbs' is an abbreviaton for 'TABLESPACE'                               */

#define SQLB_MAX_TBS_NAME_SZ   128     /* maximum length of a table space     */
                                       /* name                                */
/* NB: this constant is set to the maximum size that is likely to be needed   */
/* in future.  Don't confuse this with SQLU_MAX_TBS_NAME_LEN which is set to  */
/* the current maximum size (18).                                             */

/* Externally visibile flags of a table space                                 */
/* storage manager class                                                      */
#define SQLB_TBS_SMS           0x1     /* System   Managed Space              */
#define SQLB_TBS_DMS           0x2     /* Database Managed Space              */
/* table space contents                                                       */
#define SQLB_TBS_ANY           0x0     /* regular contents                    */
#define SQLB_TBS_LONG          0x20    /* long field data                     */
#define SQLB_TBS_TMP           0x10    /* temp data                           */
/* other flags values                                                         */
#define SQLB_TBS_TMP_RECOVERY  0x20000 /* temp table space is reserved for    */
                                       /* completion of reorg recovery        */

/* The externally visible state of a table space is composed of the           */
/* hexadecimal sum of various of the following state values.  For example if  */
/* the state is 'quiesced exclusive' and 'load pending', the value would be   */
/* 0x0004 + 0x0008 which is 0x000c.                                           */
/*                                                                            */
/* You may use the tool db2tbst to do the reverse calculation (from 0x000c    */
/* to 'load pending' and 'quiesced exclusive', for example) which is more     */
/* complex. In our example, execute:                                          */
/*                                                                            */
/*  db2tbst 0x000c                                                            */
/*                                                                            */
/* which yields:                                                              */
/*                                                                            */
/* State = Quiesced Exclusive                                                 */
/*       + Load Pending                                                       */
#define SQLB_NORMAL                  0x0    /* Normal                         */
#define SQLB_QUIESCED_SHARE          0x1    /* Quiesced: SHARE                */
#define SQLB_QUIESCED_UPDATE         0x2    /* Quiesced: UPDATE               */
#define SQLB_QUIESCED_EXCLUSIVE      0x4    /* Quiesced: EXCLUSIVE            */
#define SQLB_LOAD_PENDING            0x8    /* Load pending                   */
#define SQLB_DELETE_PENDING          0x10   /* Delete pending                 */
#define SQLB_BACKUP_PENDING          0x20   /* Backup pending                 */
#define SQLB_ROLLFORWARD_IN_PROGRESS 0x40   /* Roll forward in progress       */
#define SQLB_ROLLFORWARD_PENDING     0x80   /* Roll forward pending           */
#define SQLB_RESTORE_PENDING         0x100  /* Restore pending                */
#define SQLB_RECOVERY_PENDING        0x100  /* Recovery pending (use SQLB     */
                                            /* RESTORE_PENDING)               */
#define SQLB_DISABLE_PENDING         0x200  /* Disable pending                */
#define SQLB_REORG_IN_PROGRESS       0x400  /* Reorg in progress              */
#define SQLB_BACKUP_IN_PROGRESS      0x800  /* Backup in progress             */
#define SQLB_STORDEF_PENDING         0x1000 /* storage must be defined        */
#define SQLB_RESTORE_IN_PROGRESS     0x2000 /* Restore in progress            */
#define SQLB_STORDEF_ALLOWED         0x2000000 /* storage may be defined      */
#define SQLB_STORDEF_FINAL_VERSION   0x4000000 /* storDef is in 'final'       */
                                            /* state                          */
#define SQLB_STORDEF_CHANGED         0x8000000 /* storDef was changed prior   */
                                            /* to rollforward                 */
#define SQLB_REBAL_IN_PROGRESS       0x10000000 /* dms rebalancer is active   */
#define SQLB_PSTAT_DELETION          0x20000000 /* TBS deletion in progress   */
#define SQLB_PSTAT_CREATION          0x40000000 /* TBS creation in progress   */

/* Provide info about a tableSpace in a database                              */
SQL_STRUCTURE SQLB_TBSQRY_DATA
{
   unsigned long   id;                 /* internal id for the pool            */
   unsigned long   nameLen;            /* length of the name (for cobol &     */
                                       /* other nonC lang.)                   */
   char            name[SQLB_MAX_TBS_NAME_SZ]; /* NUL terminated name         */
   unsigned long   totalPages;         /* DMS : Pages specified by CREATE     */
                                       /* TABLESPACE.                         */
                                       /* SMS : N/A                           */
   unsigned long   useablePages;       /* DMS : totalPages - overhead         */
                                       /* SMS : N/A                           */
   unsigned long   flags;              /* bit attributes for the pool --      */
                                       /* includes 'class' & other stuff to   */
                                       /* be defined                          */
   unsigned long   pageSize;           /* pagesize of tablespace (in          */
                                       /* bytes)..currently fixed at 4K       */
   unsigned long   extSize;            /* extent size (in pages)              */
   unsigned long   prefetchSize;       /* prefetch size                       */
   unsigned long   nContainers;        /* number of containers                */
   unsigned long   tbsState;           /* SQLB_NORMAL, SQLB_LOAD_PENDING,     */
                                       /* etc.                                */
   char            lifeLSN[6];         /* 'timestamp' identifying the origin  */
                                       /* of the tbs                          */
   char            pad[2];             /* for alignment                       */
};

/* container type                                                             */
#define SQLB_CONT_PATH         0       /* SMS: directory path specs           */
#define SQLB_CONT_DISK         1       /* DMS: a 'raw' or 'device' spec       */
#define SQLB_CONT_FILE         2       /* DMS: a 'cooked file' -> file spec   */

/* provide information about the containers on which tablespaces are based    */
SQL_STRUCTURE SQLB_TBSCONTQRY_DATA
{
   unsigned long   id;                 /* container id                        */
   unsigned long   nTbs;               /* num table spaces sharing this       */
                                       /* container (is always 1 for DMS      */
                                       /* tablespaces)                        */
   unsigned long   tbsID;              /* tableSpace id, when 'nTbs' is 1     */
   unsigned long   nameLen;            /* length of name (for non-C lang.)    */
   char            name[SQLB_MAX_CONTAIN_NAME_SZ]; /* null term. name         */
   unsigned long   underDBDir;         /* 1 if container is under the DB      */
                                       /* directory, 0 if not                 */
   unsigned long   contType;           /* SQLB_CONT_PATH/DISK/FILE            */
   unsigned long   totalPages;         /* DMS : Pages specified by CREATE     */
                                       /* TABLESPACE. SMS : N/A               */
   unsigned long   useablePages;       /* DMS : totalPages - overhead SMS :   */
                                       /* N/A                                 */
   unsigned long   ok;                 /* 1 if container is accessible, 0 if  */
                                       /* there is a problem                  */
};

/* provide statistics on a tablespace                                         */
/* BETA NOTE: currently, we only provide stats on DMS tablespaces             */
/* SRSFIX: determine what SMS support to ship with V2                         */
SQL_STRUCTURE SQLB_TBS_STATS
{
   unsigned long   totalPages;         /* DMS : Pages specified by CREATE     */
                                       /* TABLESPACE.                         */
                                       /* SMS : Pages of all files in the     */
                                       /* directories.                        */
   unsigned long   useablePages;       /* DMS : totalPages - overhead         */
                                       /* SMS : same as totalPages            */
   unsigned long   usedPages;          /* DMS : used and allocated pages in   */
                                       /* the pool                            */
                                       /* SMS : same as totalPages            */
   unsigned long   freePages;          /* DMS : useablePages - usedPages      */
                                       /* SMS : N/A                           */
   unsigned long   highWaterMark;      /* DMS : high water mark of used page  */
                                       /* number                              */
                                       /* SMS : N/A                           */
};

/******************************************************************************
** Function proto-types: 'sqlb' prefix for internal use.
** All functions require a database connection, and return
** info about that database.
*******************************************************************************/

/* stsq - Single TableSpace Query                                             */
SQL_API_RC SQL_API_FN                            /* Single Tablespace Query   */
  sqlbstsq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long TablespaceId,                   /* in: tableSpace id         */
   struct SQLB_TBSQRY_DATA * pTablespaceData);   /* out: tableSpace data      */

/* otsq - Open TableSpace Query -> use for retrieving a full list             */
#define SQLB_OPEN_TBS_ALL 0x0                    /* all tablespaces in        */
                                                 /* database                  */
#define SQLB_OPEN_TBS_RESTORE 0x1                /* all tablespaces my agent  */
                                                 /* is restoring              */
#define SQLB_OPEN_TBS_STORDEF 0x2                /* all tablespaces where     */
                                                 /* storage definition is     */
                                                 /* allowed                   */
SQL_API_RC SQL_API_FN                            /* Open Tablespace Query     */
  sqlbotsq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long TablespaceQueryOptions,         /* in: processing options:   */
                                                 /* SQLB_TBS_OPEN_xxx         */
   unsigned long * pNumTablespaces);             /* out: # tablespaces        */
                                                 /* defined in db             */

/* ftsq - Fetch TableSpace Query -> fetch the next block of tbs data          */
SQL_API_RC SQL_API_FN                            /* Fetch Tablespace Query    */
  sqlbftsq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long MaxTablespaces,                 /* max num of tbs the        */
                                                 /* output area can hold      */
   struct SQLB_TBSQRY_DATA * pTablespaceData,    /* out: array of length      */
                                                 /* maxTbs                    */
   unsigned long * pNumTablespaces);             /* out: #data entries        */
                                                 /* returned                  */

/* ctsq - Close TableSpace Query -> terminate the query opened by sqlbotsq    */
SQL_API_RC SQL_API_FN                            /* Close Tablespace Query    */
  sqlbctsq (
   struct sqlca * pSqlca);                       /* SQLCA                     */

/* tsq - TableSpace Query -> uses the above primitives to return the FULL     */
/* list of tablespaces in an array allocated and returned to the              */
/* application.  The application should free this memory with the sqlefmem()  */
/* api when it is finished with it. Even if this api fails with an            */
/* 'insufficient memory' error, 'nTbs' is set to the number of tablespaces    */
/* in the database. 'nTbs' is set to zero if we fail to sucessfully open a    */
/* query. 'tbsData' is returned as NULL (0;no mem alloc) if we fail for any   */
/* reason.                                                                    */
SQL_API_RC SQL_API_FN                            /* Tablespace Query          */
  sqlbtsq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long * pNumTablespaces,              /* out: total number of      */
                                                 /* table spaces              */
   struct SQLB_TBSQRY_DATA ** ppTablespaceData); /* out: mem returned to      */
                                                 /* application               */

/* container level queries.They all accept either a tableSpace id (a single   */
/* tbs) ora special id (SQLB_ALL_TABLESPACES) which triggers the fetchof a    */
/* list of containers for the entire database.                                */

/* constant used in place of tablespace id to indicate all table spaces in    */
/* db                                                                         */
#define SQLB_ALL_TABLESPACES 0xfffe

/* otcq - Open Tablespace Container Query -- prepares for fetching a list of  */
/* container data                                                             */
SQL_API_RC SQL_API_FN                            /* Open Tablespace           */
                                                 /* Container Query           */
  sqlbotcq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long TablespaceId,                   /* in: id tbs or SQLB_ALL    */
                                                 /* TABLESPACES               */
   unsigned long * pNumContainers);              /* out:  output...the        */
                                                 /* number of containers for  */
                                                 /* the table space           */

/* ftcq - Fetch Tablespace Container Query. Fetch the next block of           */
/* container info.                                                            */
SQL_API_RC SQL_API_FN                            /* Fetch Tablespace          */
                                                 /* Container Query           */
  sqlbftcq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long MaxContainers,                  /* in:  max # entries to     */
                                                 /* return in 'data'          */
   struct SQLB_TBSCONTQRY_DATA * pContainerData, /* out: array of 'maxCont'   */
                                                 /* entries                   */
   unsigned long * pNumContainers);              /* out: # data entries       */
                                                 /* returned on this query    */

/* ctcq - Close Tablespace Container Query. Terminate processing for this     */
/* query                                                                      */
SQL_API_RC SQL_API_FN                            /* Close Tablespace          */
                                                 /* Container Query           */
  sqlbctcq (
   struct sqlca * pSqlca);

/* tcq - Tablespace Container Query                                           */
/* Like 'sqlbtsq', this api generates a complete list, allocating sufficient  */
/* memory.  The application is responsible for freeing the memory when it is  */
/* finished with it: call sqlefmem(ca,ptr).                                   */
SQL_API_RC SQL_API_FN
  sqlbtcq (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long TablespaceId,                   /* in: id a tbs or SQLB_ALL  */
                                                 /* TABLESPACES               */
   unsigned long * pNumContainers,               /* out: # entries returned   */
   struct SQLB_TBSCONTQRY_DATA ** ppContainerData);

/* stsc - Set TableSpace Containers                                           */
/* This api is to be used when the tablespace is in a 'storage definition     */
/* pending' or 'storage definition allowed' state.  These states are          */
/* possible during a restore operation, immediately prior to the restoration  */
/* of database pages.  This API is intended to assist in the provision of a   */
/* 'redirected' restore, where the user is restoring a database and a         */
/* different set of OS storage containers is desired/required.                */
/*                                                                            */
/* As input the application provides a list of storage definitions in the     */
/* SQLB_TBSCONTQRY_DATA structure (also used for query purposes). For this    */
/* api only the following fields are examined:                                */
/*                                                                            */
/* unsigned long   nameLen;    length of name (for non-C lang.)               */
/* char            name[SQLB_MAX_CONTAIN_NAME_SZ];  null term. name           */
/* unsigned long   contType;    SQLB_CONT_PATH/DISK/FILE                      */
/* unsigned long   totalPages;  DMS only                                      */
/*                                                                            */
/* processing options...pass 0 for 'nothing-special', OR in the special       */
/* bits.                                                                      */
/*                                                                            */
/* when setting containers prior to a restore/rollforward, the user may want  */
/* to IGNORE any 'add containers' in the logs.  He may simply be providing a  */
/* different 'final' state for the tablespace configuration.  The default     */
/* behavior is to redo 'alter' logrecords after a new container list has      */
/* been set.                                                                  */

#define SQLB_SET_CONT_INIT_STATE 0
#define SQLB_SET_CONT_FINAL_STATE 1

SQL_API_RC SQL_API_FN                            /* Set Tablespace            */
                                                 /* Containers                */
  sqlbstsc (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long SetContainerOptions,            /* in: processing options:   */
                                                 /* SQLB_SET_CONT_xxx         */
   unsigned long TablespaceId,                   /* in: table space which is  */
                                                 /* to be changed             */
   unsigned long NumContainers,                  /* in:#containers in the     */
                                                 /* list                      */
   struct SQLB_TBSCONTQRY_DATA * pContainerData); /* container                */
                                                 /* specifications            */

/* gtss - Get TableSpace Statistics                                           */
/* Provide some basic info about the utilization of a tablespace. BETA NOTE:  */
/* only DMS tablespace are supported at this time - SRSFIX                    */
SQL_API_RC SQL_API_FN                            /* Get Tablespace            */
                                                 /* Statistics                */
  sqlbgtss (
   struct sqlca * pSqlca,                        /* SQLCA                     */
   unsigned long TablespaceId,
   struct SQLB_TBS_STATS * pTablespaceStats);

/* END OF TABLESPACE RELATED API'S                                            */

/* Database Utility Commands -- Function Prototypes                           */

#ifndef SQLZ_STACK

#ifdef SQL_REL_10
#define sqluauth(ca) sqluauth_api(ca)
#define sqlustat(tn,idx,ilst,op,sl,ca) sqlustat_api(tn,idx,ilst,op,sl,ca)
#else
#define sqluauth(ca) sqluauth_api(ca)
#define sqluexpt(df,dcol,tcol,ft,ftm,mf,ac,out,ca)\
        sqluexpr_api(df,NULL,NULL,dcol,tcol,ft,ftm,mf,ac,out,NULL,ca)
#define sqluimpt(df,dcol,tcol,ft,ftm,mf,ac,in,out,ca)\
        sqluimpr_api(df,NULL,dcol,tcol,ft,ftm,mf,ac,in,out,NULL,NULL,ca)
#define sqluexpr(df,lp,lf,dcol,tcol,ft,ftm,mf,ac,out,r,ca)\
        sqluexpr_api(df,lp,lf,dcol,tcol,ft,ftm,mf,ac,out,r,ca)
#define sqluimpr(df,lp,dcol,tcol,ft,ftm,mf,ac,in,out,ni,r,ca)\
        sqluimpr_api(df,lp,dcol,tcol,ft,ftm,mf,ac,in,out,ni,r,ca)
#define sqlureot(tn,in,df,ca) sqlureot_api(tn,in,df,ca)
#define sqlurfwd(dbn,ac,pit,ne,fe,le,rt,us,pa,ca)\
        sqlurfwd_api(dbn,ac,pit,ne,fe,le,rt,us,pa,ca)
#define sqlurllf(dbn,ac,app,pit,ne,fe,le,rt,us,pa,ov,mo,re,ca)\
        sqlurllf_api(dbn,ac,app,pit,ne,fe,le,rt,us,pa,ov,mo,re,ca)
#define sqluload(df,lp,dc,tc,ft,fm,msg,rf,ac,in,out,wd,ct,ni,r,ca)\
        sqluload_api(df,lp,dc,tc,ft,fm,msg,rf,ac,in,out,wd,ct,ni,r,ca)
#define sqluqry(lf,rf,ca)  sqluqry_api(lf,rf,ca)
#define sqlustat(tn,idx,ilst,op,sl,ca) sqlustat_api(tn,idx,ilst,op,sl,ca)
#define sqlurlog(ac,sl,el,lb,lbs,rli,ca)\
        sqlurlog_api(ac,sl,el,lb,lbs,rli,ca)

#endif

#endif

/* General Utility Commands                                                   */

SQL_API_RC SQL_API_FN                       /* Open Recovery History File     */
                                            /* Scan                           */
  sqluhops (
   char * pDbAlias,                         /* database alias to open the     */
                                            /* scan for                       */
   char * pTimestamp,                       /* complete/partial timestamp     */
   char * pObjectName,                      /* table name or tablespace name  */
   unsigned short * pNumRows,               /* rows that match parameters     */
   unsigned short * pHandle,                /* handle used for gne/cls        */
   unsigned short CallerAction,             /* list: 0-backup; 1-history      */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Next Recovery History      */
                                            /* File Entry                     */
  sqluhgne (
   unsigned short Handle,                   /* handle returned from open      */
   void * pReserved,                        /* reserved for future use        */
   struct sqluhinfo * pHistoryInfo,         /* pointer to entry               */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Close Recovery History File    */
                                            /* Scan                           */
  sqluhcls (
   unsigned short Handle,                   /* handle returned from open      */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Prune Recovery History File    */
  sqluhprn (
   char * pTimestamp,                       /* timestamp (or partial one)     */
   unsigned short ForceOption,              /* 0 for DON'T FORCE              */
                                            /*  1 for FORCE                   */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Recovery History File   */
  sqluhupd (
   char * pObjectPart,                      /* timestamp||(001 -> 999)        */
   char * pNewLocation,                     /* the new location               */
   char * pNewDeviceType,                   /* the new device type            */
   char * pNewComment,                      /* new comment                    */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Quiesce Tablespaces for Table  */
  sqluvqdp (
   char * pTableName,                       /* fully qualified table name     */
   long QuiesceMode,                        /* 0 for share                    */
                                            /* 1 for intent to update         */
                                            /* 2 for exclusive                */
                                            /* 9 to reset                     */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Authorizations             */
  sqluadau (
   struct sql_authorizations * pAuthorizations,
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Authorizations             */
  sqluauth_api (
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Backup Database                */
  sqlubkup (
   char * pDbAlias,                         /* database alias                 */
   unsigned long BufferSize,                /* backup buffer size             */
   unsigned long BackupMode,                /* online or offline              */
   unsigned long BackupType,                /* backup type.                   */
   unsigned long CallerAction,              /* caller action                  */
   char * pApplicationId,                   /* application ID.                */
   char * pTimestamp,                       /* timestamp returned             */
   unsigned long NumBuffers,                /* num of buffers                 */
   struct sqlu_tablespace_bkrst_list * pTablespaceList, /* list of            */
                                            /* tablespace                     */
   struct sqlu_media_list * pMediaTargetList, /* list of media targ           */
   char * pUserName,                        /* user name                      */
   char * pPassword,                        /* password                       */
   void * pReserved2,                       /* reserved for future            */
   unsigned long VendorOptionsSize,         /* size of options                */
   void * pVendorOptions,                   /* reserved for vendor            */
   void * pReserved3,                       /* reserved for future            */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Restore Database               */
  sqlursto (
   char * pSourceDbAlias,                   /* source alias name              */
   char * pTargetDbAlias,                   /* target dbalias                 */
   unsigned long BufferSize,                /* restore buffer size            */
   unsigned long RollforwardMode,           /* 0 - roll forward               */
                                            /* 1 - do not roll fwd            */
   unsigned long RestoreType,               /* 0 - normal restore             */
                                            /* 3 - online restore for         */
                                            /* tablespace only                */
                                            /* 5 - history file only          */
   unsigned long CallerAction,              /* caller action                  */
   char * pApplicationId,                   /* application ID.                */
   char * pTimestamp,                       /* timestamp for backup image     */
   char * pTargetPath,                      /* target path for new database   */
   unsigned long NumBuffers,                /* num of buffers                 */
   struct sqlu_tablespace_bkrst_list * pTablespaceList, /* reserved for       */
                                            /* future use.                    */
   struct sqlu_media_list * pMediaSourceList, /* list of media controllers    */
                                            /* to use.                        */
   char * pUserName,                        /* userid                         */
   char * pPassword,                        /* password                       */
   void * pReserved2,                       /* reserved for future use        */
   unsigned long VendorOptionsSize,         /* size of options field          */
   void * pVendorOptions,                   /* reserved for vendor use        */
   void * pReserved3,                       /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Rollforward Database           */
  sqlurllf_api (
   char * pDbAlias,                         /* database alias                 */
   unsigned short CallerAction,             /* action                         */
   char * pApplicationId,                   /* application id                 */
   char * pStopTime,                        /* stop time                      */
   char * pNextArcFileName,                 /* next archive file needed       */
   char * pFirstDelArcFileName,             /* first archive file to be       */
                                            /* deleted                        */
   char * pLastDelArcFileName,              /* last archive file to be        */
                                            /* deleted                        */
   char * pLastCommitTime,                  /* last commit time               */
   char * pUserName,                        /* user name                      */
   char * pPassword,                        /* password                       */
   char * pOverflowLogPath,                 /* overflow log path              */
   unsigned short ConnectMode,              /* connect mode                   */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Old backup                     */
  sqlubckp (
   _SQLOLDCHAR *,                           /* alias name                     */
   unsigned long,                           /* backup buffer size             */
   unsigned short,                          /* online or offline              */
   unsigned short,                          /* reserved                       */
   unsigned short,                          /* ADSM or otherwise              */
   _SQLOLDCHAR *,                           /* dir or device name             */
   unsigned short,                          /* caller action                  */
   _SQLOLDCHAR *,                           /* timestamp returned             */
   _SQLOLDCHAR *,                           /* userid                         */
   _SQLOLDCHAR *,                           /* password                       */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Old Restore                    */
  sqludrst (
   _SQLOLDCHAR *,                           /* source database alias          */
   _SQLOLDCHAR *,                           /* target database alias          */
   unsigned long,                           /* restore buffer size            */
   unsigned short,                          /* media type: ADSM or otherwise  */
   _SQLOLDCHAR *,                           /* dir or device name             */
   _SQLOLDCHAR *,                           /* timestamp of backup            */
   unsigned short,                          /* roll forward flag              */
   unsigned short,                          /* caller action                  */
   _SQLOLDCHAR *,                           /* target: new dbase              */
   _SQLOLDCHAR *,                           /* userid                         */
   _SQLOLDCHAR *,                           /* password                       */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Old Rollforward Database       */
  sqlurfwd_api (
   _SQLOLDCHAR *,                           /* database name                  */
   unsigned short,                          /* action                         */
   _SQLOLDCHAR *,                           /* Stop Timestamp                 */
   _SQLOLDCHAR *,                           /* Next Archive File needed       */
   _SQLOLDCHAR *,                           /* First Archive File to be       */
                                            /* deleted                        */
   _SQLOLDCHAR *,                           /* Last Archive File to be        */
                                            /* deleted                        */
   _SQLOLDCHAR *,                           /* Returned Timestamp             */
   _SQLOLDCHAR *,                           /* userid                         */
   _SQLOLDCHAR *,                           /* password                       */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Export                         */
  sqluexpr_api (
   char * pDataFileName,                    /* data file                      */
   sqlu_media_list * pLobPathList,          /* lob paths                      */
   sqlu_media_list * pLobFileList,          /* lob files                      */
   struct sqldcol * pDataDescriptor,        /* dcoldata                       */
   struct sqlchar * pActionString,          /* tcolstrg                       */
   char * pFileType,                        /* file type                      */
   struct sqlchar * pFileTypeMod,           /* file type mod                  */
   char * pMsgFileName,                     /* msg file                       */
   short CallerAction,                      /* caller action                  */
   struct sqluexpt_out*  pOutputInfo,       /* rows exported                  */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Export                         */
  sqluexpt_api (
   _SQLOLDCHAR *,                           /* datafile                       */
   struct sqldcol *,                        /* dcoldata                       */
   struct sqlchar *,                        /* tcolstrg                       */
   _SQLOLDCHAR *,                           /* filetype                       */
   struct sqlchar *,                        /* filetmod                       */
   _SQLOLDCHAR *,                           /* msgfile                        */
   short,                                   /* caller action                  */
   struct sqluexpt_out* ,                   /* rows exported                  */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Import                         */
  sqluimpt_api (
   _SQLOLDCHAR *,                           /* datafile                       */
   struct sqldcol *,                        /* dcoldata                       */
   struct sqlchar *,                        /* tcolstrg                       */
   _SQLOLDCHAR *,                           /* filetype                       */
   struct sqlchar *,                        /* filetmod                       */
   _SQLOLDCHAR *,                           /* msgfile                        */
   short,                                   /* caller action                  */
   struct sqluimpt_in* ,                    /* input parms                    */
   struct sqluimpt_out* ,                   /* output parms                   */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Import                         */
  sqluimpr_api (
   char * pDataFileName,                    /* datafile                       */
   sqlu_media_list * pLobPathList,          /* lobpath                        */
   struct sqldcol * pDataDescriptor,        /* dcoldata                       */
   struct sqlchar * pActionString,          /* tcolstrg                       */
   char * pFileType,                        /* filetype                       */
   struct sqlchar * pFileTypeMod,           /* filetmod                       */
   char * pMsgFileName,                     /* msgfile                        */
   short CallerAction,                      /* caller action                  */
   struct sqluimpt_in*  pImportInfoIn,      /* input parms                    */
   struct sqluimpt_out*  pImportInfoOut,    /* output parms                   */
   long * pNullIndicators,                  /* nullind                        */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Load                           */
  sqluload_api (
   sqlu_media_list * pDataFileList,         /* input data files               */
   sqlu_media_list * pLobPathList,          /* input lob paths                */
   struct sqldcol * pDataDescriptor,        /* dcoldata - describes input     */
                                            /* data                           */
   struct sqlchar * pActionString,          /* tcolstrg - describes the       */
                                            /* columns of the table to load   */
   char * pFileType,                        /* file type                      */
   struct sqlchar * pFileTypeMod,           /* filetmod                       */
   char * pLocalMsgFileName,                /* message file name              */
   char * pRemoteMsgFileName,               /* remote file name               */
   short CallerAction,                      /* caller action                  */
   struct sqluload_in * pLoadInfoIn,        /* input                          */
   struct sqluload_out * pLoadInfoOut,      /* output                         */
   sqlu_media_list * pWorkDirectoryList,    /* work dirs                      */
   sqlu_media_list * pCopyTargetList,       /* copy targets                   */
   long * pNullIndicators,                  /* null ind                       */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Query                          */
  sqluqry_api (
   char * pLocalMsgFileName,                /* local msg file                 */
   char * pRemoteMsgFileName,               /* remote msg file                */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Asynchronous Read Log          */
  sqlurlog_api (
   unsigned long CallerAction,              /* caller action                  */
   SQLU_LSN * pStartLsn,                    /* read start log sequence        */
                                            /* number                         */
   SQLU_LSN * pEndLsn,                      /* read end log sequence number   */
   char * pLogBuffer,                       /* user buffer                    */
   unsigned long LogBufferSize,             /* size of user buffer            */
   SQLU_RLOG_INFO * pReadLogInfo,           /* read log information           */
                                            /* structure                      */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Reorganize Table               */
  sqlureot_api (
   _SQLOLDCHAR * pTableName,                /* table name                     */
   _SQLOLDCHAR * pIndexName,                /* fully-qualified index name     */
   _SQLOLDCHAR * pTablespace,               /* tablespace                     */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Run Statistics                 */
  sqlustat_api (
   _SQLOLDCHAR * pTableName,                /* table name                     */
   unsigned short NumIndexes,               /* number of indexes              */
   _SQLOLDCHAR ** ppIndexList,              /* indexlist                      */
   unsigned char StatsOption,               /* statsopt                       */
   unsigned char ShareLevel,                /* sharelvl                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Table Authorizations       */
  sqlutbau (
   _SQLOLDCHAR *,                           /* fully-qualified table name     */
   struct sqlca *);                         /* SQLCA                          */

/* Generic APIs                                                               */

SQL_API_RC SQL_API_FN                       /* Get Authorizations             */
  sqlgadau (
   struct sql_authorizations * pAuthorizations,
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Default Database           */
                                            /* Configuration                  */
  sqlgddb (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short NumItems,                 /* count of requested no of       */
                                            /* items                          */
   struct sqlfupd * pItemList,              /* list of items returned         */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   char * pDbAlias);                        /* database  alias                */

SQL_API_RC SQL_API_FN                       /* Reset Database Configuration   */
  sqlgrdb (
   unsigned short DbAliasLen,               /* database alias length          */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   char * pDbAlias);                        /* database alias                 */

SQL_API_RC SQL_API_FN                       /* Update Database Configuration  */
  sqlgudb (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short NumItems,                 /* count                          */
   unsigned short * pItemListLens,          /* List of item lengths           */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   char * pDbAlias);                        /* database                       */

SQL_API_RC SQL_API_FN                       /* Get Database Configuration     */
  sqlgxdb (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short NumItems,                 /* count of items being returned  */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   char * pDbAlias);                        /* database alias                 */

SQL_API_RC SQL_API_FN                       /* Get Database Manager           */
                                            /* Configuration Defaults         */
  sqlgdsys (
   unsigned short NumItems,                 /* count of items being returned  */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Backup Database                */
  sqlgbkup (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short UserNameLen,              /* user name length               */
   unsigned short PasswordLen,              /* password length                */
   unsigned short * pReserved1,             /* reserved for future use        */
   char * pDbAlias,                         /* database alias                 */
   unsigned long BufferSize,                /* buffer size in 4K units        */
   unsigned long BackupMode,                /* online or offline              */
   unsigned long BackupType,                /* 0 - full dB; 3 - tablespace    */
   unsigned long CallerAction,              /* caller action                  */
   char * pApplicationId,                   /* application ID.                */
   char * pTimestamp,                       /* timestamp returned             */
   unsigned long NumBuffers,                /* number of buffers to use       */
   struct sqlu_tablespace_bkrst_list * pTablespaceList, /* list of            */
                                            /* tablespace names               */
   struct sqlu_media_list * pMediaTargetList, /* list of media targets        */
   char * pUserName,                        /* user name                      */
   char * pPassword,                        /* password                       */
   void * pReserved2,                       /* reserved for future use        */
   unsigned long VendorOptionsSize,         /* size of options field          */
   void * pVendorOptions,                   /* reserved for vendor use        */
   void * pReserved3,                       /* reserved for future use        */
   struct sqlca * pSqlca);                  /* sqlca structure                */

SQL_API_RC SQL_API_FN                       /* Close Recovery History File    */
                                            /* Scan                           */
  sqlghcls (
   unsigned short Handle,                   /* handle returned from open      */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Next Recovery History      */
                                            /* File Entry                     */
  sqlghgne (
   unsigned short Handle,                   /* handle returned from open      */
   void * pReserved,                        /* reserved for future use        */
   struct sqluhinfo * pHistoryInfo,         /* pointer to the address of the  */
                                            /* history file entry info        */
                                            /* buffer                         */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Open Recovery History File     */
                                            /* Scan                           */
  sqlghops (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short TimestampLen,             /* timestamp length               */
   unsigned short ObjectNameLen,            /* object name length             */
   char * pDbAlias,                         /* database alias                 */
   char * pTimestamp,                       /* timestamp used to select       */
                                            /* records                        */
   char * pObjectName,                      /* object name used to select     */
                                            /* records                        */
   unsigned short * pNumRows,               /* return no. of matching         */
                                            /* history file entries           */
   unsigned short * pHandle,                /* return handle used for future  */
                                            /* access                         */
   unsigned short CallerAction,             /* '0' for backup                 */
                                            /* '1' for history                */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Prune Recovery History File    */
  sqlghprn (
   unsigned short TimestampLen,             /* timestamp id length            */
   char * pTimestamp,                       /* timestamp (whole or part)      */
   unsigned short ForceOption,              /* force option                   */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Recovery History File   */
  sqlghupd (
   unsigned short ObjectPartLen,            /* object_part length             */
   unsigned short NewLocationLen,           /* new_location length            */
   unsigned short NewDeviceTypeLen,         /* new_device_type length         */
   unsigned short NewCommentLen,            /* new_comment length             */
   char * pObjectPart,                      /* timestamp||(001 -> 999)        */
   char * pNewLocation,                     /* the new location               */
   char * pNewDeviceType,                   /* the new device type            */
   char * pNewComment,                      /* new comment                    */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Rollforward Database           */
  sqlgrllf (
   unsigned short DbAliasLen,               /* database alias length          */
   unsigned short StopTimeLen,              /* stop time length               */
   unsigned short UserNameLen,              /* user name length               */
   unsigned short PasswordLen,              /* password length                */
   unsigned short OverflowLogPathLen,       /* overflow log path length       */
   char * pDbAlias,                         /* database alias                 */
   unsigned short CallerAction,             /* caller action                  */
   char * pApplicationId,                   /* application id returned        */
   char * pStopTime,                        /* stop time                      */
   char * pNextArcFileName,                 /* next archive file              */
   char * pFirstDelArcFileName,             /* first del archive file         */
   char * pLastDelArcFileName,              /* last del archive file          */
   char * pLastCommitTime,                  /* last commit time               */
   char * pUserName,                        /* user name                      */
   char * pPassword,                        /* password                       */
   char * pOverflowLogPath,                 /* overflow log path name         */
   unsigned short ConnectMode,              /* connect mode                   */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Restore Database               */
  sqlgrsto (
   unsigned short SourceDbAliasLen,         /* source database alias length   */
   unsigned short TargetDbAliasLen,         /* target database alias length   */
   unsigned short TimestampLen,             /* timestamp length               */
   unsigned short TargetPathLen,            /* target path length             */
   unsigned short UserNameLen,              /* user name length               */
   unsigned short PasswordLen,              /* password  length               */
   unsigned short * pReserved1,             /* nodename length                */
   char * pSourceDbAlias,                   /* source database alias          */
   char * pTargetDbAlias,                   /* target database alias          */
   unsigned long BufferSize,                /* buffer size in 4K units        */
   unsigned long RollforwardMode,           /* 0 - roll forward               */
                                            /* 1 - do not roll forward        */
   unsigned long RestoreType,               /* 0 - normal restore             */
                                            /* 3 - online restore             */
                                            /*     for tablespace only        */
                                            /* 5 - history file only          */
   unsigned long CallerAction,              /* caller action                  */
   char * pApplicationId,                   /* application id returned        */
   char * pTimestamp,                       /* timestamp of backup            */
   char * pTargetPath,                      /* target: new path               */
   unsigned long NumBuffers,                /* number of buffers to use       */
   struct sqlu_tablespace_bkrst_list * pTablespaceList, /* reserved for       */
                                            /* future use                     */
   struct sqlu_media_list * pMediaSourceList, /* list of media sources        */
   char * pUserName,                        /* user name                      */
   char * pPassword,                        /* password                       */
   void * pReserved2,                       /* reserved for future use        */
   unsigned long VendorOptionsSize,         /* size of options field          */
   void * pVendorOptions,                   /* reserved for vendor use        */
   void * pReserved3,                       /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Quiesce Tablespaces for Table  */
  sqlgvqdp (
   unsigned short TableNameLen,             /* length of table_name           */
   char * pTableName,                       /* table name                     */
   long QuiesceMode,                        /* 0 for share                    */
                                            /* 1 for intent to update         */
                                            /* 2 for exclusive                */
                                            /* 9 to reset                     */
   void * pReserved,                        /* reserved for future use        */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Old Backup                     */
  sqlgbckp (
   unsigned short,                          /* password length                */
   unsigned short,                          /* userid length                  */
   unsigned short,                          /* media target length            */
   unsigned short,                          /* database name length           */
   struct sqlca *,                          /* ptr to sqlca                   */
   _SQLOLDCHAR *,                           /* ptr to password                */
   _SQLOLDCHAR *,                           /* ptr to userid                  */
   _SQLOLDCHAR *,                           /* ptr to timestamp               */
   unsigned short,                          /* caller action                  */
   _SQLOLDCHAR *,                           /* ptr to media target            */
   unsigned short,                          /* media type                     */
   unsigned short,                          /* reserved                       */
   unsigned short,                          /* backup mode                    */
   unsigned long,                           /* buffer size                    */
   _SQLOLDCHAR *);                          /* ptr to database name           */

SQL_API_RC SQL_API_FN                       /* Restore                        */
  sqlgdrst (
   unsigned short,                          /* password length                */
   unsigned short,                          /* userid length                  */
   unsigned short,                          /* target length                  */
   unsigned short,                          /* timestamp length               */
   unsigned short,                          /* media source length            */
   unsigned short,                          /* target database length         */
   unsigned short,                          /* source database length         */
   struct sqlca *,                          /* ptr to sqlca                   */
   _SQLOLDCHAR *,                           /* ptr to password                */
   _SQLOLDCHAR *,                           /* ptr to userid                  */
   _SQLOLDCHAR *,                           /* ptr to target                  */
   unsigned short,                          /* caller action                  */
   unsigned short,                          /* restore mode                   */
   _SQLOLDCHAR *,                           /* ptr to timestamp               */
   _SQLOLDCHAR *,                           /* ptr to media source            */
   unsigned short,                          /* media type                     */
   unsigned long,                           /* buffer size                    */
   _SQLOLDCHAR *,                           /* ptr to target database         */
   _SQLOLDCHAR *);                          /* ptr to source database         */

SQL_API_RC SQL_API_FN                       /* EXPORT FROM                    */
  sqlgexpr (
   unsigned short DataFileNameLen,          /* data file name length          */
   unsigned short FileTypeLen,              /* file type length               */
   unsigned short MsgFileNameLen,           /* msg file name length           */
   char * pDataFileName,                    /* data file                      */
   sqlu_media_list * pLobPathList,          /* lob paths                      */
   sqlu_media_list * pLobFileList,          /* lob file names                 */
   struct sqldcol * pDataDescriptor,        /* dcoldata                       */
   struct sqlchar * pActionString,          /* tcolstrg                       */
   char * pFileType,                        /* file type                      */
   struct sqlchar * pFileTypeMod,           /* file type mod                  */
   char * pMsgFileName,                     /* msg file name                  */
   short CallerAction,                      /* caller action                  */
   struct sqluexpt_out*  pOutputInfo,       /* rows exported                  */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Export                         */
  sqlgexpt (
   unsigned short,                          /* message file name length       */
   unsigned short,                          /* file type length               */
   unsigned short,                          /* data file name length          */
   struct sqlca *,                          /* SQLCA                          */
   struct sqluexpt_out* ,                   /* ptr to rows exported           */
   short,                                   /* caller action                  */
   _SQLOLDCHAR *,                           /* message file name              */
   struct sqlchar *,                        /* ptr to file type mod           */
   _SQLOLDCHAR *,                           /* ptr to filetype                */
   struct sqlchar *,                        /* ptr to tcolstrg                */
   struct sqldcol *,                        /* ptr to dcoldata                */
   _SQLOLDCHAR *);                          /* data file name                 */

SQL_API_RC SQL_API_FN                       /* Import                         */
  sqlgimpr (
   unsigned short DataFileNameLen,          /* datafile length                */
   unsigned short FileTypeLen,              /* file type length               */
   unsigned short MsgFileNameLen,           /* msgfile length                 */
   char * pDataFileName,                    /* data file name                 */
   sqlu_media_list * pLobPathList,          /* lobpaths                       */
   struct sqldcol * pDataDescriptor,        /* dcoldata                       */
   struct sqlchar * pActionString,          /* tcolstrg                       */
   char * pFileType,                        /* filetype                       */
   struct sqlchar * pFileTypeMod,           /* filetmod                       */
   char * pMsgFileName,                     /* message file name              */
   short CallerAction,                      /* caller action                  */
   struct sqluimpt_in*  pImportInfoIn,      /* input parms                    */
   struct sqluimpt_out*  pImportInfoOut,    /* output parms                   */
   long * NullIndicators,                   /* nullind                        */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Import                         */
  sqlgimpt (
   unsigned short,                          /* message file name length       */
   unsigned short,                          /* file type length               */
   unsigned short,                          /* data file name length          */
   struct sqlca *,                          /* SQLCA                          */
   struct sqluimpt_out *,                   /* ptr to output parms            */
   struct sqluimpt_in *,                    /* ptr to input parms             */
   short,                                   /* caller action                  */
   _SQLOLDCHAR *,                           /* message file name              */
   struct sqlchar *,                        /* file mode description          */
   _SQLOLDCHAR *,                           /* file type                      */
   struct sqlchar *,                        /* ptr to table/column            */
   struct sqldcol *,                        /* ptr to column data             */
   _SQLOLDCHAR *);                          /* data file name                 */

SQL_API_RC SQL_API_FN                       /* Load                           */
  sqlgload (
   unsigned short FileTypeLen,              /* file type length               */
   unsigned short LocalMsgFileNameLen,      /* message file length            */
   unsigned short RemoteMsgFileNameLen,     /* remote file length             */
   sqlu_media_list * pDataFileList,         /* data file name                 */
   sqlu_media_list * pLobPathList,          /* lobpaths                       */
   struct sqldcol * pDataDescriptor,        /* dcoldata                       */
   struct sqlchar * pActionString,          /* tcolstrg                       */
   char * pFileType,                        /* file type                      */
   struct sqlchar * pFileTypeMod,           /* filetmod                       */
   char * pLocalMsgFileName,                /* message file name              */
   char * pRemoteMsgFileName,               /* remote file name               */
   short CallerAction,                      /* caller action                  */
   struct sqluload_in * pLoadInfoIn,        /* input                          */
   struct sqluload_out * pLoadInfoOut,      /* output                         */
   sqlu_media_list * pWorkDirectoryList,    /* work directory                 */
   sqlu_media_list * pCopyTargetList,       /* copy target                    */
   long * pNullIndicators,                  /* null ind                       */
   void * pReserved,                        /* reserved                       */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Query                          */
  sqlgqry (
   unsigned short LocalMsgFileNameLen,      /* lf_length                      */
   unsigned short RemoteMsgFileNameLen,     /* rf_length                      */
   char * pLocalMsgFileName,                /* local file                     */
   char * pRemoteMsgFileName,               /* remote file                    */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Reorganize Table               */
  sqlgreot (
   unsigned short TablespaceLen,            /* tablespace length              */
   unsigned short IndexNameLen,             /* index name length              */
   unsigned short TableNameLen,             /* table name length              */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   _SQLOLDCHAR * pTablespace,               /* tablespace                     */
   _SQLOLDCHAR * pIndexName,                /* index name                     */
   _SQLOLDCHAR * pTableName);               /* table name                     */

SQL_API_RC SQL_API_FN                       /* Rollforward                    */
  sqlgrfwd (
   unsigned short,                          /* password length                */
   unsigned short,                          /* userid length                  */
   unsigned short,                          /* point in time length           */
   unsigned short,                          /* database name length           */
   struct sqlca *,                          /* SQLCA                          */
   _SQLOLDCHAR *,                           /* password                       */
   _SQLOLDCHAR *,                           /* userid                         */
   _SQLOLDCHAR *,                           /* last commit time               */
   _SQLOLDCHAR *,                           /* last archive del               */
   _SQLOLDCHAR *,                           /* first archive del              */
   _SQLOLDCHAR *,                           /* next archive need              */
   _SQLOLDCHAR *,                           /* point in time                  */
   unsigned short,                          /* action                         */
   _SQLOLDCHAR *);                          /* database name                  */

SQL_API_RC SQL_API_FN                       /* Run Statistics                 */
  sqlgstat (
   unsigned short TableNameLen,             /* table name length              */
   unsigned short NumIndexes,               /* number of indices              */
   unsigned char StatsOption,               /* stats option                   */
   unsigned char ShareLevel,                /* share level                    */
   unsigned short * pIndexLens,             /* index lengths                  */
   struct sqlca * pSqlca,                   /* SQLCA                          */
   _SQLOLDCHAR ** ppIndexList,              /* index list                     */
   _SQLOLDCHAR * pTableName);               /* table name                     */

SQL_API_RC SQL_API_FN                       /* Dereference Address            */
  sqlgdref (
   unsigned int NumBytes,                   /* number of bytes to transfer    */
   char * pTargetBuffer,                    /* target area for transfer       */
   char ** ppSourceBuffer);                 /* source area for transfer       */

SQL_API_RC SQL_API_FN                       /* Copy Memory                    */
  sqlgmcpy (
   void * pTargetBuffer,                    /* area into which to move the    */
                                            /* data                           */
   const void * pSource,                    /* area from which to move the    */
                                            /* data                           */
   unsigned long NumBytes);                 /* number of bytes to move        */

SQL_API_RC SQL_API_FN                       /* Return address                 */
  sqlgaddr (
   char * pVariable,                        /* variable                       */
   char ** ppOutputAddress);                /* ptr to an area containing the  */
                                            /* address                        */

/* Configuration Utility Commands                                             */

SQL_API_RC SQL_API_FN                       /* Reset Database Manager         */
                                            /* Configuration                  */
  sqlfrsys (
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Reset Database Configuration   */
  sqlfrdb (
   _SQLOLDCHAR * pDbAlias,                  /* database alias                 */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Database Manager        */
                                            /* Configuration                  */
  sqlfusys (
   unsigned short NumItems,                 /* count of entries being         */
                                            /* modified                       */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Database Configuration  */
  sqlfudb (
   _SQLOLDCHAR * pDbAlias,                  /* database alias                 */
   unsigned short NumItems,                 /* count of entries being         */
                                            /* modified                       */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Database Manager           */
                                            /* Configuration                  */
  sqlfxsys (
   unsigned short NumItems,                 /* count of entries being         */
                                            /* returned                       */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Database Configuration     */
  sqlfxdb (
   _SQLOLDCHAR * pDbAlias,                  /* database alias                 */
   unsigned short NumItems,                 /* count of entries being         */
                                            /* returned                       */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Database Manager           */
                                            /* Configuration Defaults         */
  sqlfdsys (
   unsigned short NumItems,                 /* count of items being returned  */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Database Configuration     */
                                            /* Defaults                       */
  sqlfddb (
   char * pDbAlias,                         /* database alias                 */
   unsigned short NumItems,                 /* count of entries to return     */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Reset Database Manager         */
                                            /* Configuration                  */
  sqlgrsys (
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Database Manager        */
                                            /* Configuration                  */
  sqlgusys (
   unsigned short NumItems,                 /* count of entries being         */
                                            /* modified                       */
   unsigned short * pItemListLens,          /* list of item lengths           */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Get Database Manager           */
                                            /* Configuration                  */
  sqlgxsys (
   unsigned short NumItems,                 /* count of entries being         */
                                            /* returned                       */
   struct sqlfupd * pItemList,              /* list of items                  */
   struct sqlca * pSqlca);                  /* SQLCA                          */

SQL_API_RC SQL_API_FN                            /* Single TableSpace Query   */
  sqlgstsq (
   struct sqlca * pSqlca,
   unsigned long TablespaceId,                   /* in: tableSpace id         */
   struct SQLB_TBSQRY_DATA * pTablespaceData);   /* out: tableSpace data      */

SQL_API_RC SQL_API_FN                            /* Open TableSpace Query     */
  sqlgotsq (
   struct sqlca * pSqlca,
   unsigned long TablespaceQueryOptions,         /* in: processing options:   */
                                                 /* SQLB_TBS_OPEN_xxx         */
   unsigned long * pNumTablespaces);             /* out: # tablespaces        */
                                                 /* defined in db             */

SQL_API_RC SQL_API_FN                            /* Fetch TableSpace Query    */
  sqlgftsq (
   struct sqlca * pSqlca,
   unsigned long MaxTablespaces,                 /* size of output area       */
   struct SQLB_TBSQRY_DATA * pTablespaceData,    /* out: array of length      */
                                                 /* maxTbs                    */
   unsigned long * pNumTablespaces);             /* out: #data entries        */
                                                 /* returned                  */

SQL_API_RC SQL_API_FN                            /* Close TableSpace Query    */
  sqlgctsq (
   struct sqlca * pSqlca);

SQL_API_RC SQL_API_FN                            /* TableSpace Query          */
  sqlgtsq (
   struct sqlca * pSqlca,
   unsigned long * pNumTablespaces,              /* out: total number of      */
                                                 /* table spaces              */
   struct SQLB_TBSQRY_DATA ** ppTablespaceData); /* out: mem returned to      */
                                                 /* application               */

SQL_API_RC SQL_API_FN                            /* Open Tablespace           */
                                                 /* Container Query           */
  sqlgotcq (
   struct sqlca * pSqlca,
   unsigned long TablespaceId,                   /* in: id tbs or SQLB_ALL    */
                                                 /* TABLESPACES               */
   unsigned long * pNumContainers);              /* out:  output...the        */
                                                 /* number of containers for  */
                                                 /* the table space           */

SQL_API_RC SQL_API_FN                            /* Fetch Tablespace          */
                                                 /* Container Query           */
  sqlgftcq (
   struct sqlca * pSqlca,
   unsigned long MaxContainers,                  /* in:  max # entries to     */
                                                 /* return in 'data'          */
   struct SQLB_TBSCONTQRY_DATA * pContainerData, /* out: array of 'maxCont'   */
                                                 /* entries                   */
   unsigned long * pNumContainers);              /* out: # data entries       */
                                                 /* returned on this query    */

SQL_API_RC SQL_API_FN                            /* Close Tablespace          */
                                                 /* Container Query           */
  sqlgctcq (
   struct sqlca * pSqlca);

SQL_API_RC SQL_API_FN                            /* Tablespace Container      */
                                                 /* Query                     */
  sqlgtcq (
   struct sqlca * pSqlca,
   unsigned long TablespaceId,                   /* in: id a tbs or SQLB_ALL  */
                                                 /* TABLESPACES               */
   unsigned long * pNumContainers,               /* out: # entries returned   */
   struct SQLB_TBSCONTQRY_DATA ** ppContainerData);

SQL_API_RC SQL_API_FN                            /* Set TableSpace            */
                                                 /* Containers                */
  sqlgstsc (
   struct sqlca * pSqlca,
   unsigned long SetContainerOptions,            /* in: processing options:   */
                                                 /* SQLB_SET_CONT_xxx         */
   unsigned long TablespaceId,                   /* in: table space which is  */
                                                 /* to be changed             */
   unsigned long NumContainers,                  /* in:#containers in the     */
                                                 /* list                      */
   struct SQLB_TBSCONTQRY_DATA * pContainerData); /* container                */
                                                 /* specifications            */

SQL_API_RC SQL_API_FN                            /* Get TableSpace            */
                                                 /* Statistics                */
  sqlggtss (
   struct sqlca * pSqlca,
   unsigned long TablespaceId,
   struct SQLB_TBS_STATS * pTablespaceStats);

SQL_API_RC SQL_API_FN                            /* Get Authorizations        */
  sqlgauth (
   struct sqlca * pSqlca);                       /* SQLCA                     */

SQL_API_RC SQL_API_FN                            /* Get table authorizations  */
  sqlgtbau (
   unsigned short,                               /* table name length         */
   _SQLOLDCHAR *,                                /* fully-qualified table     */
                                                 /* name                      */
   struct sqlca *);                              /* SQLCA                     */

/* SQL Return Codes in SQLCODE for UTILITY/CONFIGURATION Commands             */

#ifndef SQL_RC_OK
#define SQL_RC_OK               0   /* everything is ok                */
#endif
#ifndef SQL_RC_INVALID_SQLCA
#define SQL_RC_INVALID_SQLCA   -1   /* invalid sqlca                   */
#endif

/* ROLL FORWARD Return Codes - more in the 4900's                             */

#define SQLU_RC_NOLFH                  -1258   /* Log Control file not        */
                                               /* found.                      */
#define SQLU_RC_IOELFH                 -1259   /* I/O Error accessing LFH.    */
#define SQLU_RC_RFNOTEN                -1260   /* DB not enabled for Roll     */
                                               /* Fwd                         */
#define SQLU_RC_RFNOTP                 -1261   /* Roll Forward is not         */
                                               /* Pending                     */
#define SQLU_RC_BADPIT                 -1262   /* Bad Point in Time           */
                                               /* specified                   */
#define SQLU_RC_INVEXT                 -1263   /* Invalid Log Extent file     */
#define SQLU_RC_NOTEXT                 -1264   /* Log Extent file does not    */
                                               /* belong to DB                */
#define SQLU_RC_IVREXT                 -1265   /* Log extent file is          */
                                               /* incorrect version           */
#define SQLU_RC_PRTIME                 -1266   /* Time specified is before    */
                                               /* previous roll-forward time  */
#define SQLU_RC_UEXIT_ERR              -1268   /* User exit encountered an    */
                                               /* error (other than retry)    */
                                               /* while attempting to         */
                                               /* retrieve a log extent file  */
                                               /* for roll forward            */
#define SQLU_RC_RFINPRG                -1269   /* Rollforward by tablespace   */
                                               /* in progress.                */
#define SQLU_RC_RCVIOERR               1271    /* Roll forward complete but   */
                                               /* I/O errors encountered      */
#define SQLU_RC_RFSTOP                 -1272   /* Rollforward by tablespace   */
                                               /* has stopped.                */
#define SQLU_RC_MISSING_EXT            -1273   /* Missing log extent file.    */
#define SQLU_RC_INVTSP_STOPTIME        -1274   /* Invalid stop time for       */
                                               /* tablespace rollforward.     */
#define SQLU_INVRFR_STOPTIME           -1275   /* invalid stop time           */
                                               /* specified                   */
#define SQLU_INVRFR_STOP               -1276   /* invalid time to issue a     */
                                               /* stop                        */
#define SQLUD_INACCESSABLE_CONTAINER   1277    /* Restore found one or more   */
                                               /* containers are              */
                                               /* inaccessable                */
#define SQL_RC_RECREATE_INDEXES        1279    /* Restart complete but not    */
                                               /* all invalid  indexes were   */
                                               /* recreated                   */

#define SQLF_RC_INV_CLIENT_COMM        -1290   /* invalid client comm.        */
                                               /* protocols                   */
#define SQLF_RC_INV_DIR_FIELD          -1296   /* invalid directory services  */
                                               /* field                       */

#define SQLCC_RC_UNKNOWN_HOST          -1336   /* hostname in node dir        */
                                               /* unknown                     */
#define SQLCC_RC_UNKNOWN_SERVICE       -1337   /* service name in node        */
                                               /* directory is unknown        */
#define SQLCC_RC_UNKNOWN_SYM_DEST_NAME -1338   /* CPI-C symdestname is        */
                                               /* unknown                     */
#define SQLCC_RC_NNAME_NOTFOUND        -1341   /* wrkstn name (nname)         */
#define SQLCC_RC_NO_SOCKS_ENV_VAR      -1460   /* SOCKS env vars not found    */

/* GENERAL UTILITY Return Codes                                               */

#define SQLU_BAD_DRIVE                 -2000   /* Invalid output drive        */
#define SQLU_USER_TERM                 -2001   /* Backup terminated by user   */
#define SQLU_NOT_LOCAL                 -2002   /* database not local          */
#define SQLU_DOS_ERROR                 -2003   /* base op system error        */
#define SQLU_SQL_ERROR                 -2004   /* SQL error occurred          */
#define SQLU_READ_ERROR                -2005   /* read wrong # of bytes       */
#define SQLU_INVALID_ACTION            -2008   /* call out of sequence        */
#define SQLU_INSUFF_MEMORY             -2009   /* insufficient memory         */
#define SQLU_STRD_ERROR                -2010   /* error in Start Using        */
#define SQLU_STPD_ERROR                -2011   /* error in Stop Using         */
#define SQLU_DIR_ERROR                 -2013   /* directory Scan error        */
#define SQLU_INVALID_DBNAME            -2015   /* invalid database name       */
#define SQLU_INVALID_PATH              -2016   /* invalid path in             */
                                               /* environment                 */
#define SQLU_START_SESSION             -2017   /* Start Session failed        */
#define SQLU_INVALID_AUTHS             -2018   /* invalid authorizations      */
#define SQLU_AUTOBIND                  -2019   /* auto-binding failed         */
#define SQLU_TIMESTAMP                 -2020   /* conflict after auto-bind    */
                                               /* control file                */
#define SQLU_IO_ERROR_LFH              -2023   /* I/O error in accessing the  */
                                               /* log                         */
#define SQLU_IO_ERROR_BRG              -2024   /* I/O error in accessing the  */
                                               /* Backup/Restore flag file    */
#define SQLU_IO_ERROR                  -2025   /* System I/O error occurred   */
#define SQLU_PAUSE_ERROR               -2026   /* error in PAUSE the started  */
                                               /* DB                          */
#define SQLU_CONT_ERROR                -2027   /* error in CONTINUE the       */
                                               /* stoped DB                   */
#define SQLU_INT_INST_ERR              -2028   /* interruption installing     */
                                               /* error                       */
#define SQLU_UEXIT_RC                  -2029   /* user exit returned non      */
                                               /* zero rc                     */

#define SQLU_FIRST_TAPE_WARNING        2031    /* warning to mount tape       */
#define SQLU_INVALID_PARM              -2032   /* parameter to utility        */
                                               /* incorrect                   */
#define SQLU_ADSM_ERROR                -2033   /* ADSM reported error         */
#define SQLU_INVALID_PARM_ADDRESS      -2034   /* address of parameter        */
                                               /* incorrect                   */
#define SQLU_NOINT_ERROR               -2035   /* error during nointerrupt    */
                                               /* action                      */
#define SQLU_PATH_ERROR                -2036   /* directory does not exist    */
#define SQLU_LOAD_ADSM_ERROR           -2037   /* unable to load ADSM         */
#define SQLU_DBSYSTEM_ERROR            -2038   /* database system error       */
#define SQLU_NO_APP_ERROR              -2039   /* application terminated      */
#define SQLU_ALIAS_ERROR               -2040   /* alias parameter error       */
#define SQLU_BUFFSIZE_ERROR            -2041   /* buff_size parameter error   */
#define SQLU_IO_WARNING                2042    /* I/O error during change     */
                                               /* tape                        */
#define SQLU_SPAWN_EDU_ERROR           -2043   /* Spawn child process error   */
#define SQLU_QUEUE_ERROR               -2044   /* Message queue error         */
#define SQLU_OBJECT_ACCESS_ERROR       -2048   /* Object access error         */
#define SQLU_CORRUPT_IMAGE_ERROR       -2054   /* Bad backup image            */
#define SQLU_MEMORY_ACCESS_ERROR       -2055   /* Unable to access memory     */
                                               /* set                         */
#define SQLU_UNKNOWN_MEDIA_TYPE        -2056   /* device path point to        */
                                               /* unknown device type         */
#define SQLU_MEDIA_CANNOT_BE_SHARED    -2057   /* device or file already      */
                                               /* opened by other process     */
#define SQLU_END_OF_MEDIA_WARNING      2058    /* End of tape or file         */
                                               /* encountered during read     */
#define SQLU_DEVICE_FULL_WARNING       2059    /* Device is full during       */
                                               /* write                       */
#define SQLU_MEDIA_EMPTY_WARNING       2060    /* Empty device or file not    */
                                               /* found during read           */
#define SQLU_MEDIA_ACCESS_DENIED       -2061   /* Access denied due to        */
                                               /* authority level             */
#define SQLU_MEDIA_ACCESS_ERROR        -2062   /* Access error                */
#define SQLU_TERM_LAST_MEDIA_WARNING   2065    /* Terminate last Media IO.    */
#define SQLU_BAD_TABLESPACE_NAME       -2066   /* Invalid tablespace name     */
#define SQLU_NO_MEDIA_HEADER           -2068   /* Could not locate media      */
                                               /* header in backup or copy    */
                                               /* image                       */
#define SQLU_INCORRECT_DBALIAS         -2069   /* Mismatch alias name from    */
                                               /* media                       */
#define SQLU_INCORRECT_TIMESTAMP       -2070   /* Mismatch timestamp read     */
                                               /* from media                  */

#define SQLU_SHR_LIB_ACCESS_ERROR      -2071   /* Shared library access       */
                                               /* error                       */
#define SQLU_BIND_SHR_LIB_ERROR        -2072   /* Bind shared library error   */

#define SQLUD_TSP_RESTORE_OUT_OF_SEQ   -2154   /* Out of sequence tablespace  */
                                               /* restore                     */

/* HISTORY TABLE Return Codes                                                 */
#define SQLUH_SCAN_UPDATED_WARNING     2155    /* Changes were made to        */
                                               /* historyfile during update.  */
#define SQLUH_MAX_SCANS_EXCEEDED       -2157   /* MAX # open scans exceeded   */
#define SQLUH_FILE_REPLACED_WARNING    2160    /* History file fixed          */
#define SQLUH_DAMAGED_FILE             -2161   /* History file is unfixable   */
#define SQLUH_SQLUHINFO_VARS_WARNING   2165    /* number of tablespaces       */
                                               /* changed                     */
#define SQLUH_ENTRY_NOT_FOUND          -2171   /* Entry not found on update   */

/* REORGANIZE TABLE Return Codes                                              */
#define SQLUR_INVALID_AUTHID           -2200   /* invalid authid on index     */
                                               /* name                        */
#define SQLUR_INVALID_TABLENAME        -2203   /* invalid tablename syntax    */
#define SQLUR_INVALID_INDEXNAME        -2204   /* invalid tablename syntax    */
#define SQLUR_INDEX_NOT_FOUND          -2205   /* index doesn't exist         */
#define SQLUR_INVALID_FILEPATH         -2207   /* invalid filepath pointer    */
#define SQLUR_INVALID_TABLESPACE       -2208   /* invalid tablespace pointer  */
#define SQLUR_TABLE_NOT_FOUND          -2211   /* table does not exist        */
#define SQLUR_VIEW_ERROR               -2212   /* cannot reorg a view         */
#define SQLUR_INCORRECT_TABLESPACE     -2213   /* Incorrect tablespace type   */
#define SQLUR_INSAUTH                  -2214   /* insuffic authority          */
#define SQLUR_SQLERR_COMPREV           -2215   /* SQL error commiting prev    */
                                               /* work                        */
#define SQLUR_SQLERR_REORG             -2216   /* SQL error during            */
                                               /* reorganization              */

/* RUN STATISTICS Return Codes                                                */
#define SQLUS_INVALID_AUTHID           -2300   /* invalid authid              */
#define SQLUS_INVALID_TABLE_NAME       -2301   /* invalid table name          */
#define SQLUS_INVALID_INDEX_LIST       -2302   /* invalid index pointer       */
#define SQLUS_INVALID_STATS_OPT        -2303   /* statsopt parameter invalid  */
#define SQLUS_INVALID_SHARE_LEV        -2304   /* sharelev parameter invalid  */
#define SQLUS_VIEWS_NOT_ALLOWED        -2305   /* table specified is a view   */
#define SQLUS_OBJ_DOES_NOT_EXIST       -2306   /* object doesn't exist        */
#define SQLUS_SYS_TABLE_NOT_ALLOWED    -2307   /* system table not allowed    */
#define SQLUS_INVALID_INDEX_AUTHID     -2308   /* index authid invalid        */
#define SQLUS_INVALID_INDEX_NAME       -2309   /* index name invalid          */
#define SQLUS_ERROR_STAT               -2310   /* error running statistics    */
#define SQLUS_INSAUTH                  -2311   /* insuffic authority for      */
                                               /* runstats                    */
#define SQLUS_STATS_HEAP_TOO_SMALL     -2312   /* statistics heap is too      */
                                               /* small                       */
#define SQLUS_PARTIAL_SUCCESS          2313    /* incomplete statistics       */
                                               /* collected                   */

#define SQLUD_RST_NOROLLFWD            3       /* Rst DB turn off roll fwd    */
                                               /* pend, old OS/2 API only     */
/* Old OS/2 Backup calling action values                                      */
#define SQLU_BACK_ALL                  0x0     /* backup entire database      */
#define SQLU_BACK_CHANGES              0x1     /* backup changes only         */
#define SQLU_BACK_QUIESCE              0x800   /* quiesce during backup       */
#define SQLU_NEW_UOW_RETURN_ERROR      0x400   /* New UOW return error immed  */

#define SQLU_DBM_ERROR                 -2014   /* pause or Continue or        */
                                               /* migration error             */
#define SQLU_WRONG_DISKETTE            -2021   /* Wrong diskette inserted     */
#define SQLU_DISK_FULL                 -2030   /* a specific fixed disk is    */
                                               /* full                        */

#define SQLUB_BAD_TYPE                 -2400   /* invalid type                */
#define SQLUB_TYPE_MUSTBE_DB           -2401   /* type must be database       */
#define SQLUB_USER_NOT_AUTH            -2403   /* insufficient auth for       */
                                               /* backup                      */
#define SQLUB_MEDIA_FULL               -2404   /* The target disk/diskette    */
                                               /* is full                     */
#define SQLUB_BR_INPROG                -2407   /* The Backup can't run        */
                                               /* because B/R flag file       */
                                               /* existed and read I/O error  */
                                               /* occurred                    */
#define SQLUB_DEL_BRG_ERR              2408    /* Backup process is           */
                                               /* successful, but unable to   */
                                               /* delete BRG file             */
#define SQLUB_WRONG_BASE_IMAGE         -2409   /* 'change-only' is only       */
                                               /* applied to the most recent  */
                                               /* base image                  */
#define SQLUB_NO_CHG_NSD               -2410   /* change only, backup not     */
                                               /* allowed to user exit        */
#define SQLUB_IO_ERROR                 -2411   /* I/O error during backup     */
#define SQLUD_BIND_WARNING             2507    /* Restore utility not bound   */
#define SQLUD_DROP_ERROR               -2511   /* error dropping database     */

/* BACKUP Return Codes                                                        */
#define SQLUB_RST_IN_PROG              -2405   /* The backup can't run        */
                                               /* because the Restore is in   */
                                               /* progress                    */
#define SQLUB_ROLLFWD_PENDING          -2406   /* The Backup can't run        */
                                               /* because roll forward is     */
                                               /* pending                     */
#define SQLUB_CORRUPT_PAGE             -2412   /* data page encountered       */
                                               /* during backup is corrupted  */
#define SQLUB_LOGRETAIN_ONLINE_ERROR   -2413   /* retain req'd for online     */
                                               /* backup                      */
#define SQLUB_INSUF_SPACE_WARNING      2414    /* no space for control info   */
#define SQLUB_NEXT_TAPE_WARNING        2416    /* tape full, mount another    */
#define SQLUB_DBASE_DOES_NOT_EXIST     -2418   /* database does not exist     */
#define SQLUB_DISK_FULL_ERROR          -2419   /* disk full during backup     */

#define SQLUB_FIRST_TAPE_ERROR         -2420   /* first tape cannot hold      */
                                               /* header                      */
#define SQLUB_LOGRETAIN_TBS_ERROR      -2421   /* retain req'd for tbs        */
                                               /* backup                      */
#define SQLUB_DB_UNSUPPORTED_BY_API    -2422   /* the backup API used does    */
                                               /* not support this format of  */
                                               /* database                    */
#define SQLUB_MISSING_INDEX            -2423   /* A required index is         */
                                               /* missing during an offline   */
                                               /* backup                      */

/* RESTORE Return Codes                                                       */
#define SQLUD_CANNOT_RESTORE           -2501   /* can't read restored         */
                                               /* database                    */
#define SQLUD_DISKETTE_ERROR           -2502   /* error reading backup        */
                                               /* diskette                    */
#define SQLUD_WRONG_DATABASE           -2503   /* wrong backup diskette       */
#define SQLUD_DISKETTE_PROMPT          2504    /* prompt for backup diskette  */
#define SQLUD_DROP_WARNING             2505    /* warn that drop will be      */
                                               /* done                        */
#define SQLUD_DATABASE_WARNING         2506    /* Restore worked, but not     */
                                               /* cleanup                     */
#define SQLUD_INVALID_TIMESTAMP        -2508   /* timestamp incorrectly       */
                                               /* specified                   */
#define SQLUD_INVALID_DBDRV            -2509   /* invalid database drive      */
#define SQLUD_SEM_ERROR                -2510   /* semaphore error             */
#define SQLUD_CREATE_ERROR             -2512   /* error creating database     */
#define SQLUD_REN_ERROR                -2513   /* error renaming database     */
#define SQLUD_BAD_VERSION              -2514   /* restored database wrong     */
                                               /* version                     */
#define SQLUD_INSAUTH                  -2515   /* insuffic authority to       */
                                               /* restore                     */
#define SQLUD_DBACT                    -2516   /* a database active           */
#define SQLUD_MIGRATED                 2517    /* database migrated           */
#define SQLUD_RST_DBCONG_ERR           -2518   /* error in restoring DB       */
                                               /* config.                     */
#define SQLUD_MIGRATE_ERROR            -2519   /* error in migrating the      */
                                               /* database                    */
#define SQLUD_DBCON_WARN               2520    /* DBCON file is restored      */
                                               /* using the backup version    */
#define SQLUD_DEL_BRG_ERR              2521    /* Restore process is          */
                                               /* successful, but unable to   */
                                               /* delete BRG file             */
#define SQLUD_TOO_MANY_BACKUP_FILES    -2522   /* more than one file match    */
#define SQLUD_MEDIA_CORRUPT            -2530   /* corrupted backup image      */
#define SQLUD_WRGIMAGE_ERROR           -2532   /* image of wrong database     */
#define SQLUD_WRGIMAGE_WARNING         2533    /* image of wrong database     */
#define SQLUD_WRONGSEQ_WARNING         2536    /* seq number of backup        */
                                               /* incorrect                   */
#define SQLUD_MUST_ROLLFWD             -2537   /* roll forward required       */
#define SQLUD_UNEXPECT_EOF_ERROR       -2538   /* end of file reached         */
                                               /* unexpectedly                */
#define SQLUD_NOINT_WARNING            2540    /* noint type restore had      */
                                               /* warning                     */
#define SQLUD_CLOSE_MEDIA_WARNING      2541    /* unable to close backup      */
                                               /* file                        */
#define SQLUD_NO_BACKUP_FILE_MATCH     -2542   /* no backup file match found  */
#define SQLUD_DB_DIR_ERROR             -2543   /* invalid directory for new   */
                                               /* dbase                       */
#define SQLUD_DISK_FULL_ERROR          -2544   /* disk full during restore    */
#define SQLUD_NOT_FIRST_IMAGE          -2546   /* restore requires first      */
                                               /* image first                 */
#define SQLUD_OLD_ONLINE_IMAGE_ERROR   -2547   /* cannot restore online       */
                                               /* backup from a previous      */
                                               /* release                     */
#define SQLUD_IMAGE_DB_CP_MISMATCH     -2548   /* backup has diff codepage    */
                                               /* from disk DB                */

/******************************************************************************
**  the meaning of the following 8 warnings :
**        A -> database alias
**        N -> database name
**        S -> database seed
**        0 -> target db value DOES NOT matches backup image value
**        1 -> target db value matches backup image value
** 
*******************************************************************************/
#define SQLUD_A0N0S0_WARNING           2529
#define SQLUD_A0N0S1_WARNING           2528
#define SQLUD_A0N1S0_WARNING           2525
#define SQLUD_A0N1S1_WARNING           2524
#define SQLUD_A1N0S0_WARNING           2527
#define SQLUD_A1N0S1_WARNING           2526
#define SQLUD_A1N1S0_WARNING           2523
#define SQLUD_A1N1S1_WARNING           2539
#define SQLUD_TBLSP_TO_OTHER_DB        -2560   /* restore tablespace to a     */
                                               /* non original database.      */
#define SQLUD_TBLSP_TO_NEW_DB          2561    /* restore tablespace to a     */
                                               /* new data base.              */
#define SQLUD_TBLSP_FR_FULL_BKUP       -2562   /* restore tablespace from     */
                                               /* full backup image.          */
#define SQLUD_NOTALL_TBS_RESTORED      2563    /* Not all tablespases were    */
                                               /* restored                    */
#define SQLUD_DB_MISMATCH              2565    /* Mismatch between restore    */
                                               /* image and database          */
                                               /* restored to                 */
#define SQLU_HEADER_WRITE_ERR          2045    /* Problem on first media      */
                                               /* write                       */

/* sqlgadau and sqluadau Return codes                                         */
#define SQLUA_BAD_INPUT_PARAMETER      -2600   /* sql_authorizations parm is  */
                                               /* bad                         */

/* Asynchronous Read Log SQLCODES                                             */
#define SQLU_RLOG_INVALID_PARM         -2650   /* invalid parameter(s)        */
                                               /* detected                    */
#define SQLU_RLOG_DB_NOT_READABLE      -2651   /* database has circular logs  */
#define SQLU_RLOG_INSUFF_MEMORY        -2652   /* insufficient memory for     */
                                               /* internal buffer             */
#define SQLU_RLOG_LSNS_REUSED           2653   /* log sequence numbers        */
                                               /* reused                      */
#define SQLU_RLOG_READ_TO_CURRENT       2654   /* read to end of database     */
                                               /* log                         */
#define SQLU_RLOG_EXTDB_INCORRECT      -2655   /* log extent not for this     */
                                               /* database                    */
#define SQLU_RLOG_INVALID_EXTENT       -2656   /* invalid extent encountered  */
#define SQLU_RLOG_EXTENT_REQUIRED      -2657   /* log reader requires an      */
                                               /* extent not in the log path  */

/* IMPORT/EXPORT Return codes                                                 */
#define SQLUE_DFO                      -3001   /* error opening output file   */
#define SQLUE_IOE                      -3002   /* i/o error writing output    */
                                               /* file                        */
#define SQLUE_CLS                      -3003   /* i/o error closing output    */
                                               /* file                        */
#define SQLUE_IFT                      -3004   /* invalid filetype parameter  */
#define SQLUE_CBI                      -3005   /* function interrupted        */
#define SQLUE_MFO                      -3006   /* i/o error opening message   */
                                               /* file                        */
#define SQLUE_MFW                      -3007   /* i/o error writing message   */
                                               /* file                        */
#define SQLUE_STA                      -3008   /* start using database        */
                                               /* failed                      */
#define SQLUE_STR                      -3009   /* invalid tcolstrg            */
#define SQLUE_COL                      -3010   /* invalid dcoldata            */

#define SQLUE_MEM                      -3011   /* memory allocation error     */
#define SQLUE_SYSERR                   -3012   /* system error                */
#define SQLUE_FTMOD                    -3013   /* invalid filetmod            */
#define SQLUE_MFC                      -3014   /* failure on closing message  */
                                               /* file                        */
#define SQLUE_SQLERR                   -3015   /* SQL error occurred          */
#define SQLUE_FMODNK                   -3016   /* no keywords found           */
#define SQLUE_FMODID                   -3017   /* invalid delimiter or        */
                                               /* duplicate                   */
#define SQLUE_FMODDEC                  -3018   /* decimal used for char       */
                                               /* delimiter                   */
#define SQLUE_NTS                      -3019   /* no tcolstrg                 */
#define SQLUE_RC_INSAUTH               -3020   /* insufficient authority for  */
                                               /* exp.                        */

#define SQLUI_RC_INSAUTH               -3021   /* insufficient authority for  */
                                               /* imp.                        */
#define SQLUE_SQL_PREP_ERR             -3022   /* SQL error on input string   */
#define SQLUE_DATABASE                 -3023   /* invalid database name       */
#define SQLUE_DATAFILE                 -3025   /* invalid datafile            */
#define SQLUE_MSGFILE                  -3026   /* invalid msgfile             */
#define SQLUE_DCOLMETH                 -3028   /* Export method indicator     */
                                               /* not n/d                     */
#define SQLUE_NUL_FTYPE                -3029   /* filetype is null            */

#define SQLUI_DFO                      -3030   /* error opening input data    */
                                               /* file                        */
#define SQLUI_IOE                      -3031   /* i/o error reading input     */
                                               /* file                        */
#define SQLUI_DCOLMETH                 -3032   /* Import method not n/d/p     */
#define SQLUI_TINSERT                  -3033   /* invalid insert in tcolstrg  */
#define SQLUI_TINTO                    -3034   /* invalid into in tcolstrg    */
#define SQLUI_TABLENAME                -3035   /* invalid tablename in        */
                                               /* tcolstrg                    */
#define SQLUI_CPAREN                   -3036   /* close paren not in          */
                                               /* tcolstrg                    */
#define SQLUE_SQL_PREP_INSERT          -3037   /* SQL error on insert string  */
#define SQLUI_TCOLJUNK                 -3038   /* tcolstrg invalid            */
#define SQLUE_LOBFILE_ERROR            -3040   /* lob file error              */

#define SQLUIC_BAD_DCOL_POS            -3045   /* invalid dcol position for   */
                                               /* CSV                         */
#define SQLUI_NONDEF_DCOL_NOCOLS       -3046   /* non-default dcol and no     */
                                               /* cols                        */
#define SQLUI_BAD_DCOL_METH            -3047   /* dcolinfo has invalid        */
                                               /* method                      */
#define SQLUI_NODCOL_FOR_NONNULL_DBCOL -3048   /* non nullable column         */
#define SQLUIC_UNSUPTYP_NONULLS        -3049   /* unsupported column type     */

#define SQLUII_CONVERSION              3050    /* conversion for cdpg         */
#define SQLUE_ROWCT_TOOBIG             -3053   /* too many rows for WSF       */
                                               /* export                      */
#define SQLUII_HEOF                    -3054   /* eof reading first rec in    */
                                               /* IXF                         */
#define SQLUII_HLEN_CONV               -3055   /* length of 'H' rec not       */
                                               /* numeric                     */
#define SQLUII_HLEN_SHORT              -3056   /* first record too short      */
#define SQLUII_HTYP                    -3057   /* first IXF rec is not 'H'    */
#define SQLUII_HID                     -3058   /* no IXF identifier in 'H'    */
#define SQLUII_HVERS                   -3059   /* invalid version field in    */
                                               /* 'H'                         */

#define SQLUII_HCNT                    -3060   /* HCNT in 'H' not numeric     */
#define SQLUII_HSBCP_BAD               -3061   /* SBCP in 'H' not numeric     */
#define SQLUII_HDBCP_BAD               -3062   /* DBCP in 'H' not numeric     */
#define SQLUII_HSBCP_CMP               -3063   /* 'H' SBCP not compat w/data  */
                                               /* SBCP                        */
#define SQLUII_HDBCP_CMP               -3064   /* 'H' DBCP not compat w/data  */
                                               /* DBCP                        */
#define SQLUII_DB_CODEPG               -3065   /* can't get codepages         */
#define SQLUII_TEOF                    -3066   /* eof reading/looking for     */
                                               /* 'T' rec                     */
#define SQLUII_TLEN_CONV               -3067   /* length of 'T' rec not       */
                                               /* numeric                     */
#define SQLUII_TLEN_SHORT              -3068   /* 'T' record is too short     */
#define SQLUII_TTYP                    -3069   /* first non-'A' rec not 'T'   */
                                               /* rec                         */

#define SQLUII_ALEN_BAD                -3070   /* invalid rec length of 'A'   */
                                               /* rec                         */
#define SQLUII_TCONV                   -3071   /* invalid data convention in  */
                                               /* 'T'                         */
#define SQLUII_TFORM                   -3072   /* invalid data format in 'T'  */
#define SQLUII_TMFRM                   -3073   /* invalid machine form in     */
                                               /* 'T'                         */
#define SQLUII_TLOC                    -3074   /* invalid data location in    */
                                               /* 'T'                         */
#define SQLUII_TCCNT                   -3075   /* 'C' rec cnt in 'T' not      */
                                               /* numeric                     */
#define SQLUII_TNAML                   -3076   /* name len fld in 'T' not     */
                                               /* numeric                     */
#define SQLUII_CCNT_HIGH               -3077   /* too many 'C' records        */
#define SQLUII_ALEN_CONV               -3078   /* length of 'A' rec not       */
                                               /* numeric                     */
#define SQLUII_CLEN_CONV               -3079   /* length of 'C' rec not       */
                                               /* numeric                     */

#define SQLUII_CLEN_SHORT              -3080   /* 'C' record is too short     */
#define SQLUII_CTYP                    -3081   /* wrong rec type / 'C'        */
                                               /* expected                    */
#define SQLUII_CEOF                    -3082   /* EOF while processing 'C'    */
                                               /* recs                        */
#define SQLUII_CDRID                   -3083   /* 'D' rec id field not        */
                                               /* numeric                     */
#define SQLUII_CPOSN                   -3084   /* 'D' rec posn field not      */
                                               /* numeric                     */
#define SQLUII_CIDPOS                  -3085   /* 'D' id/position not         */
                                               /* consistent                  */
#define SQLUII_NOCREC_FOR_NONNULL_DBCOL -3086  /* IXF column does not exist   */
#define SQLUII_INVCREC_NONNULL_DBCOL   -3087   /* IXF column not valid        */
#define SQLUII_CRECCOMP_NONNULL_DBCOL  -3088   /* IXF column not compatible   */
#define SQLUII_DTYP                    -3089   /* wrong rec type / 'D'        */
                                               /* expected                    */

#define SQLUII_DLEN_CONV               -3090   /* length of 'D' rec not       */
                                               /* numeric                     */
#define SQLUII_DLEN_RANGE              -3091   /* length of 'D' rec not       */
                                               /* valid                       */
#define SQLUII_DID                     -3092   /* invalid id field in 'D'     */
                                               /* rec                         */
#define SQLUIW_IFILE_INV               -3093   /* import file not valid WSF   */
#define SQLUIW_NNCOL_LOST              -3094   /* DOS non-nullable name not   */
                                               /* found                       */
#define SQLUIW_PCOL_INV                -3095   /* col position out of range   */
#define SQLUIW_UCOLTYP_NONUL           -3096   /* unsup col type - not        */
                                               /* nullable                    */
#define SQLUIW_RECLEN_INV              -3097   /* record length invalid       */
#define SQLUIW_INROW_INV               -3098   /* row number out of range     */
#define SQLUIW_INCOL_INV               -3099   /* col number out of range     */

#define SQLUE_COL_TOOBIG               3100    /* column longer than 254      */
                                               /* chars                       */
#define SQLUE_DATA_CHARDEL             3101    /* column has char delimiter   */
#define SQLUE_DCNUM_HIGH               3102    /* dcol column nbr > tcol      */
                                               /* number                      */
#define SQLUE_DCNUM_LOW                3103    /* dcol column nbr < tcol      */
                                               /* number                      */
#define SQLUE_WARNING                  3107    /* warning message issued      */

#define SQLUI_FEWER_DCOLS_DBCOLS_NULLED 3112   /* extra database cols         */
#define SQLUIC_UNSUPTYP_NULLABLE       3113    /* column will be nulled       */
#define SQLUIC_IGNORED_CHAR            3114    /* character ignored           */
#define SQLUIC_FIELD_TOO_LONG          3115    /* input CSV field too long    */
#define SQLUIC_CF_REQFIELD_MISSING     3116    /* field value missing         */
#define SQLUIC_CFINT2_NULLED           3117    /* smallint field nulled       */
#define SQLUIC_CFINT2_ROWREJ           3118    /* smallint field error        */
#define SQLUIC_CFINT4_NULLED           3119    /* int field nulled            */

#define SQLUIC_CFINT4_ROWREJ           3120    /* int field error             */
#define SQLUIC_CFFLOAT_NULLED          3121    /* float field nulled          */
#define SQLUIC_CFFLOAT_ROWREJ          3122    /* float field error           */
#define SQLUIC_CFDEC_NULLED            3123    /* decimal field nulled        */
#define SQLUIC_CFDEC_ROWREJ            3124    /* decimal field error         */
#define SQLUIC_CFTRUNC                 3125    /* char field truncated        */

#define SQLUIC_CFCHAR_NULLED           3126    /* char field nulled           */
#define SQLUIC_CFCHAR_ROWREJ           3127    /* char field error            */
#define SQLUIC_CFDATETRUNC             3128    /* date field truncated        */
#define SQLUIC_CFDTPAD                 3129    /* date/time/stamp field       */
                                               /* padded                      */

#define SQLUIC_CFTIMETRUNC             3130    /* time field truncated        */
#define SQLUIC_CFSTAMPTRUNC            3131    /* stamp field truncated       */
#define SQLUE_TRUNCATE                 3132    /* char field truncated        */
#define SQLUIC_ROWTOOSHORT             3137    /* not enough columns          */
#define SQLUIC_EOF_IN_CHARDELS         3138    /* end of input data file      */
#define SQLUE_SQLSTPDB_ERR             3139    /* stop using database failed  */

#define SQLUE_WSFLAB_LEN               3142    /* WSF label too big           */
#define SQLUE_CHAR_MTRUNC              3143    /* WSF char type length too    */
                                               /* long                        */
#define SQLUE_CHAR_WTRUNC              3144    /* WSF char type length too    */
                                               /* long                        */
#define SQLUE_CHAR_ITRUNC              3145    /* WSF char truncated at 240   */
#define SQLUE_ROWCT_LARGE              3147    /* row count exceeds 2048      */
#define SQLUE_3148                     3148    /* row not inserted            */

#define SQLUII_TCNTCMP                 3154    /* 'H' hcnt not equal 'T' rec  */
                                               /* ccnt                        */
#define SQLUII_CNAML                   3155    /* invalid name length in 'C'  */
                                               /* rec                         */
#define SQLUII_CNULL                   3156    /* invalid null field in 'C'   */
                                               /* rec                         */
#define SQLUII_CTYPE                   3157    /* invalid type field in 'C'   */
                                               /* rec                         */
#define SQLUII_CSBCP                   3158    /* invalid SBCP field in 'C'   */
                                               /* rec                         */
#define SQLUII_CDBCP                   3159    /* invalid DBCP field in 'C'   */
                                               /* rec                         */

#define SQLUII_CLENG                   3160    /* invalid col len fld in 'C'  */
                                               /* rec                         */
#define SQLUII_CPREC                   3161    /* invalid precision in 'C'    */
                                               /* rec                         */
#define SQLUII_CSCAL                   3162    /* invalid scale field in 'C'  */
                                               /* rec                         */
#define SQLUII_CFLOAT_BLANKLENG        3163    /* use 00008 for float col     */
                                               /* length                      */
#define SQLUII_CFLOAT_BADLENG          3164    /* invalid float col len in    */
                                               /* 'C'.                        */
#define SQLUII_CUTYPE                  3165    /* 'C' record has invalid      */
                                               /* type                        */
#define SQLUII_NOCREC_FOR_NULL_DBCOL   3166    /* IXF col does not exist      */
#define SQLUII_INVCREC_FOR_NULL_DBCOL  3167    /* IXF col is invalid          */
#define SQLUII_CRECCOMP_NULL_DBCOL     3168    /* IXF col not compatible      */

#define SQLUII_DEOF_INROW              3170    /* EOF found in row of data    */
#define SQLUIW_NONLAB_HDR              3171    /* non-label cell in hdr row   */
#define SQLUIW_NCOL_LOST               3172    /* nullable colnam not found   */
#define SQLUIW_UCOLTYP_NULL            3174    /* unsup col type - nullable   */
#define SQLUIW_INTYPE_INV              3175    /* wrong rec type for db col   */
#define SQLUIW_DATE_INV                3176    /* date value out of range     */
#define SQLUIW_TIME_INV                3177    /* time value out of range     */
#define SQLUIW_INTIME_INV              3178    /* int rec for time invalid    */
#define SQLUIW_NODATA_NNULL            3179    /* no data / non nullable col  */

#define SQLUE_INSERT_DISK              3180    /* insert diskette request     */
#define SQLUII_AE_NOTFOUND             3181    /* file ended before AE rec    */
#define SQLUII_INSERT_DISK_RETRY       3182    /* retry to insert diskette    */
#define SQLUEC_NOBLANK_B4KW            3183    /* mult del o'rides/no blanks  */
#define SQLUI_PREVMESG_ROWNO           3185    /* row of previous warning     */
#define SQLUI_LOGFULL_INSWARN          3186    /* log full inserting row      */
#define SQLUI_INDEX_WARN               3187    /* error creating index        */
#define SQLUI_TRUNCATE_TABLE           -3188   /* error truncating table      */

#define SQLUI_INDEXIXF                 -3190   /* invalid INDEXIXF option     */
#define SQLUI_VIEW_ERROR               -3193   /* cannot import to this view  */
#define SQLUI_SYSTBL_ERROR             -3194   /* cannot import system table  */
#define SQLUE_RETRY_DISK               3195    /* not enough space            */
#define SQLUI_IN_NOTFD                 -3196   /* input file not found        */
#define SQLUI_IMPBUSY                  -3197   /* import/export in use        */

#define SQLUI_REPL_PAR                 -3201   /* cant replace parent table   */
#define SQLUI_IUOPT_NOPK               -3203   /* cant update without PK's    */
#define SQLUI_IUOPT_NOVIEW             -3204   /* cant update views           */
#define SQLUI_VIEW_REF                 -3205   /* cant replace ref cons view  */
#define SQLUI_VIEW_SQUERY              -3206   /* cant replace subquery view  */

#define SQLUE_PROVIDE_FILE_PART        3220    /* AIX req next file           */
#define SQLUI_START_COMMIT             3221    /* start commit                */
#define SQLUI_FINISH_COMMIT            3222    /* finish commit               */
#define SQLUI_BAD_STRUCT_PARM          -3223   /* bad input parms             */
#define SQLUI_SKIPPED_ALL_ROWS         -3225   /* restartcnt too big          */
#define SQLUI_COMPOUND_ERR             -3250   /* compound=x error            */

#define SQLUIW_RCSEQ_INV               -3300   /* row/col sequence invalid    */
#define SQLUIW_BOF_INV                 -3301   /* BOF in middle of WSF file   */
#define SQLUIW_EARLY_EOF               -3302   /* unexpected EOF              */
#define SQLUI_IXFONLY                  -3303   /* filetype not ixf            */
#define SQLUI_DELTABLE                 -3304   /* table does not exist        */
#define SQLUI_CREATE_ERR               -3305   /* table already exists        */
#define SQLUI_EXECUTE_ERR              -3306   /* SQL error during insert     */
#define SQLUI_INC_COL                  -3307   /* incomplete col info         */
#define SQLUI_CP_MISMATCH              -3308   /* codepage mismatch           */
#define SQLUI_DBLDATA                  -3309   /* double byte data found      */

#define SQLUI_UNREC_CTYPE              -3310   /* unrec col type              */
#define SQLUI_INVCREC_FOR_CREATE       -3310   /* invalid IXF column          */

#define SQLUE_DISK_FULL_DB2OS2         -3313   /* disk full - OS/2            */
#define SQLUE_DISK_FULL_DB2NT          -3313   /* disk full - Windows NT      */
#define SQLUE_DISK_FULL_DB2DOS         -3313   /* disk full - DOS             */
#define SQLUE_DISK_FULL_DB2WIN         -3313   /* disk full - Windows         */
#define SQLUE_DISK_FULL_DB2AIX         -10018  /* disk full - AIX             */
#define SQLUE_DISK_FULL_DB2MAC         -3313   /* disk full - MacOS           */

#define SQLUE_DISK_FULL                SQLUE_DISK_FULL_DB2AIX

#define SQLUII_ASTAMP_NOMATCH          -3314   /* 'A' data/ time not as 'H'.  */
#define SQLUII_ACREC_BADVOL            -3315   /* invalid volume info         */
#define SQLUII_CLOSE_NOTLAST           -3316   /* error closing IXF file      */
#define SQLUW_FTMOD_INV                -3317   /* conflict in filetmod        */
#define SQLUEC_DUP_KEYWORD             -3318   /* keyword repeated/filetmod   */
#define SQLUI_ERR_CREATETAB            -3319   /* error creating table        */

#define SQLUEC_NOROOM_AFTERKW          -3320   /* keyword at end of filetmod  */
#define SQLUI_LOGFULL_INSERR           -3321   /* circular log full           */
#define SQLUE_SEM_ERROR                -3322   /* semaphore error             */
#define SQLUE_INVCOLTYPE               -3324   /* column type invalid         */
#define SQLUEW_IGNORED_ROW             3325    /* ignored WSF row             */
#define SQLUI_COL_LIST                 -3326   /* column list invalid         */
#define SQLUEI_SYSERROR                -3327   /* system error                */

#define SQLUII_ODD2GRAPH               3330    /* odd leng char -> graphic    */
#define SQLUE_OEACCESS                 -3331   /* permission denied           */
#define SQLUE_OEMFILE                  -3332   /* too many files open         */
#define SQLUE_OENOENT                  -3333   /* no such file or directory   */
#define SQLUE_OENOMEM                  -3334   /* not enough memory           */
#define SQLUE_OENOSPC                  -3335   /* no space left               */

#define SQLUIA_BAD_DCOL_METH           -3400   /* invalid method for ASC      */
#define SQLUI_DCOLM_ALL                -3401   /* invalid import method       */
#define SQLUIA_NULLLOC                 -3402   /* zeroes as begin/end         */
#define SQLUIA_LOCPAIR                 -3403   /* invalid pair                */
#define SQLUIA_LOCNUM                  -3404   /* invalid pair for number     */
#define SQLUIA_LOCDATE                 -3405   /* invalid pair for date       */
#define SQLUIA_LOCTIME                 -3406   /* invalid pair for time       */
#define SQLUIA_LOCSTAMP                -3407   /* invalid pair for timestamp  */
#define SQLUIA_LOCLONG                 3408    /* pair defines long field     */
#define SQLUIA_LOCSHORT                3409    /* pair defines short field    */
#define SQLUIA_LOCODD                  -3410   /* invalid pair for graphic    */
#define SQLUIA_CFGRAPH_NULLED          3411    /* value not graphic--null     */
#define SQLUIA_CFGRAPH_ROWREJ          3412    /* value not graphic--not      */
                                               /* null                        */
#define SQLUIA_SHORTFLDNULLED          3413    /* field too short--nulled     */

#define SQLU_TOO_MANY_WARNINGS         3502    /* number of warnings hit      */
                                               /* threshold                   */
#define SQLU_ROWCNT                    3503    /* number of rows hit          */
                                               /* threshold                   */
#define SQLULA_INVALID_RECLEN          -3505   /* reclen > 32767              */
#define SQLULA_NULLIND_IGNORED         3506    /* null ind value not Y or N   */
#define SQLUI_NULLIND                  -3507   /* nullind column is invalid   */
#define SQLUL_FILE_ERROR               -3508   /* file access error during    */
                                               /* load                        */
#define SQLUL_NUM_ROW_DELETED          3509    /* num of row deleted after    */
                                               /* load                        */
#define SQLU_SORT_WORK_DIR_ERROR       -3510   /* work directory is invalid   */
#define SQLU_NB_LOBFILE_MISSING        3511    /* lobfile missing but         */
                                               /* nullable col                */
#define SQLU_NNB_LOBFILE_MISSING       3512    /* lobfile missing,            */
                                               /* nonnullable col             */
#define SQLUL_UNMATCHED_CODEPAGE       -3513   /* codepage doesn't match db   */
#define SQLUL_SYSERR_WITH_REASON       -3514   /* system error with reason    */
                                               /* code                        */
#define SQLUL_UNEXPECTED_RECORD        -3517   /* unexpected rec in db2cs     */
#define SQLUL_INCOMPATIBLE_TABLE       -3518   /* coltype incompatible for    */
                                               /* db2cs                       */
#define SQLUL_FILE_NOT_FOUND           -3521   /* missing file                */
#define SQLUL_COPY_LOGRETAIN_OFF       -3522   /* copy spec, no logretain     */
                                               /* userexit                    */
#define SQLUL_NO_MESSAGES              3523    /* no messages to be           */
                                               /* retrieved                   */
#define SQLUL_FREESPACE_OPT            -3524   /* freespace option invalid    */
#define SQLU_INCOMPAT_OPT              -3525   /* incompatible options        */
#define SQLU_NEXT_TAPE_WARNING         3700    /* mount new tape              */
#define SQLU_LOBPATHS_IGNORED          3701    /* no lobs/longs but lobpath   */
                                               /* nonull                      */
#define SQLU_DEVICE_IGNORED            3702    /* device error but ignored    */
#define SQLU_NUM_BUFFERS               -3704   /* invalid number of buffers   */
#define SQLU_BUFFER_SIZE_ERROR         -3705   /* invalid load/unload buffer  */
                                               /* size                        */
#define SQLUL_DISK_FULL                -3706   /* copy target full            */
#define SQLU_SORT_BUFFSIZE_ERROR       -3707   /* invalid sort buffer size    */

/* Load / unload / load recovery SQLCODES                                     */
#define SQLU_OPEN_COPY_LOC_FILE_ERROR  -3783
#define SQLU_INV_COPY_LOC_FILE_INPUT   -3784
#define SQLU_LOAD_RECOVERY_FAILED      -3785
#define SQLU_INVALID_PARM_WARNING      3798
#define SQLU_LOAD_RECOVERY_PENDING     3799

/* load recovery - copy location input error type                             */
#define SQLU_KEYWORD_CODE              1
#define SQLU_OVERRIDE_CODE             2
#define SQLU_UNEXPECTED_EOF_CODE       3
#define SQLU_IOERROR_CODE              4

/* Loadapi SQLCODES                                                           */
#define SQLU_INVALID_QUIESCEMODE       -3802
#define SQLU_INVALID_INDEX             -3804
#define SQLU_INVALID_LOADAPI_ACTION    -3805
#define SQLU_CONSTRAINTS_NOT_OFF       -3806
#define SQLU_NO_LIFEBOAT               -3414

/* Export SQLCODES                                                            */
#define SQLUE_MSG                      -3999   /* Export message              */

/* Roll-Forward Recovery SQLCODES                                             */
#define SQLU_INVALID_PARAM             -4904   /* invalid parameter           */
#define SQLU_INVALID_RANGE             -4905   /* invalid parameter range     */

/* Configuration SQLCODES                                                     */
#define SQLF_RC_SYSAUTH                -5001   /* only SYSADM_GROUP can       */
                                               /* change db2 configuration    */
                                               /* file                        */
#define SQLF_RC_SYSERR                 -5005   /* system error                */
#define SQLF_RC_PATHNAME               -5010   /* path name error             */
#define SQLF_RC_INVNODENAME            -5020   /* invalid node name           */
#define SQLF_RC_INVSYSIDX              -5021   /* invalid system flag         */
#define SQLF_RC_INVDBIDX               -5022   /* invalid database flag       */
#define SQLF_RC_KCON                   -5025   /* not current db2             */
                                               /* configuration               */
#define SQLF_RC_INVSYSADM              -5028   /* invalid sysadm_group        */
#define SQLF_RC_REL                    -5030   /* invalid release number      */
#define SQLF_RC_NEEDMIG                -5035   /* database needs migration;   */
                                               /* release number is back      */
                                               /* level                       */

#define SQLF_RC_INSMEM                 -5047   /* insufficient memory to      */
                                               /* support stack switching     */
#define SQLF_RC_SYSCSUM                -5050   /* invalid db2 configuration   */
                                               /* file                        */
#define SQLF_RC_DBCSUM                 -5055   /* invalid db configuration    */
                                               /* file                        */
#define SQLF_RC_INVTKN                 -5060   /* invalid token parameter     */
#define SQLF_RC_INVTKN_STRUCT          -5061   /* invalid ptr to sqlfupd      */
#define SQLF_RC_INVTKN_PTR             -5062   /* invalid token ptr value     */
#define SQLF_RC_INVNT                  -5065   /* invalid node type           */
#define SQLF_RC_CNTINV                 -5070   /* invalid count parameter     */
#define SQLF_RC_CNTBRK                 -5075   /* interrupt received          */
#define SQLF_RC_INVILF                 -5083   /* invalid initial log size    */

#define SQLF_RC_INVLFE                 -5091   /* invalid logfile extention   */
#define SQLF_RC_INVNLE                 -5092   /* invalid # of log extention  */
#define SQLF_RC_INVNEWLOGP             -5099   /* invalid new log path        */

#define SQLF_RC_INVDB1                 -5101   /* incompatible logfile        */
                                               /* parameter                   */
#define SQLF_RC_INV_BIT_VALUE          -5112   /* invalid bit value - must    */
                                               /* be 0 or 1                   */

#define SQLF_RC_LF_1_3                 -5120   /* both R1 & R3 Log            */
                                               /* parameters may not be       */
                                               /* modified                    */
#define SQLF_RC_INVDETS                -5121   /* invalid DB configuration    */
                                               /* details                     */
#define SQLF_RC_PROTECT                -5122   /* database is copy protected  */
#define SQLF_RC_LOGIO                  -5123   /* I/O Error with log header   */
#define SQLF_RC_INV_DBMENT             -5126   /* invalid db2 config file     */
                                               /* entry                       */
#define SQLF_RC_INV_RANGE              -5130   /* integer out of range        */
#define SQLF_RC_INV_RANGE_2            -5131   /* integer out of range (-1)   */
#define SQLF_RC_INV_STRING             -5132   /* string null or too long     */
#define SQLF_RC_INV_SET                -5133   /* char/int not in set         */
#define SQLF_RC_INVTPNAME              -5134   /* tpname not valid            */
#define SQLF_RC_LOW_APPLS_AND_LOCKS    -5135   /* maxappls*maxlocks too low   */
#define SQLF_RC_INV_DBPATH             -5136   /* dftdbpath not valid         */
#define SQLF_RC_INV_DIAGPATH           -5137   /* diagpath not valid          */
#define SQLF_RC_MAX_ITEMS_EXCEEDED     -5139   /* To many items on update or  */
                                               /* get                         */
#define SQLF_RC_INV_AUTHENTICATION     -5140   /* invalid authentication      */
#define SQLF_RC_INV_AVG_APPLS          -5141   /* invalid AVG_APPLS           */
#define SQLF_RC_INV_AGENTPRI           -5131   /* invalid agent priority      */
#define SQLF_RC_INV_RANGE_MAX_EXPR     -5144   /* out of range - maximum      */
                                               /* limited by an expression    */
#define SQLF_RC_INV_RANGE_MAX_EXPR_2   -5145   /* out of range - maximum      */
                                               /* limited by an expression    */
                                               /* (range includes -1)         */
#define SQLF_RC_INV_RANGE_MIN_EXPR     -5146   /* out of range - minimum      */
                                               /* limited by an expression    */
#define SQLF_RC_INV_RANGE_MIN_EXPR_2   -5147   /* out of range - minimum      */
                                               /* limited by an expression    */
                                               /* (range includes -1)         */

/* Repository for obsolete Return Codes                                       */

#define SQLU_WRITE_ERROR               -2006   /* wrote wrong # of bytes      */
#define SQLU_CONNECT_ERROR             -2010   /* error in Start Using        */
#define SQLU_INT_ERROR                 -2012   /* error in ints               */
#define SQLUD_NO_MHEADER_ERROR         -2531   /* media header not present    */
#define SQLUD_NO_MHEADER_WARNING       2534    /* media header missing        */
#define SQLUD_NEXT_TAPE_WARNING        2535    /* another tape mount          */
                                               /* required                    */
#define SQLUD_ADSM_MOUNT_WAIT          2545    /* waiting for ADSM server to  */
                                               /* access data on removable    */
                                               /* media                       */

/******************************************************************************
** Configuration parameter obsolete return codes defines -  
** Some configuration parameters had specific out of range return
** codes; these have been replaced by generic out of range messages
** In these cases the old token names for the specific return codes
** are given, but the values are replaced by the new values returned 
** when out of range.
*******************************************************************************/

#define SQLF_RC_DBAUTH                 -5002   /* only SYSADM can             */
                                               /* changedatabase              */
                                               /* configuration file          */
#define SQLF_RC_INVNDB                 -5130   /* invalid # of concurrent db  */
#define SQLF_RC_INVRIO                 -5130   /* invalid req I/O blk size    */
#define SQLF_RC_INVSIO                 -5015   /* invalid serv I/O blk size   */
#define SQLF_RC_INVCHEAP               -5016   /* invalid communications      */
                                               /* heap                        */
#define SQLF_RC_INVRSHEAP              -5017   /* invalid remote services     */
                                               /* heap                        */
#define SQLF_RC_INVSHPTHR              -5130   /* invalid sort heap           */
                                               /* threshold                   */
#define SQLCC_RC_BAD_DB2COMM           -5036   /* invalid DB2COMM value       */
#define SQLCC_RC_NO_SERV_IN_DBMCFG     -5037   /* service name not definein   */
                                               /* db2 config file             */
#define SQLCC_RC_SERV_NOT_FOUND        -5038   /* service name not found in   */
                                               /* etc/services file           */
#define SQLCC_RC_INT_PORT_NOT_FOUND    -5039   /* interrupt port not found    */
                                               /* in/etc/services file        */
#define SQLCC_RC_SOCKADDR_IN_USE       -5040   /* socket address in use       */
#define SQLCC_RC_NO_TPN_IN_DBMCFG      -5041   /* trans program name not      */
                                               /* definedin db2               */
                                               /* configuration file          */
#define SQLCC_RC_COMM_SUPPORT_FAILED   -5042   /* general failure in          */
                                               /* servercommunications        */
                                               /* support                     */
#define SQLF_RC_INVNLL                 -5130   /* invalid # of locklist       */
#define SQLF_RC_INVNBP                 -5130   /* invalid # bufr pool pages   */
#define SQLF_RC_INVNDBF                -5130   /* invalid # of DB files open  */
#define SQLF_RC_INVSCP_DB2OS2          -5130   /* invalid soft check point    */
                                               /* value                       */
#define SQLF_RC_INVSCP_DB2AIX          -5130   /* invalid soft check point    */
                                               /* value                       */
#define SQLF_RC_INVSCP                 -5130   /* invalid soft check point    */
                                               /* value                       */
#define SQLF_RC_INVNAP                 -5130   /* invalid # of active appls   */
#define SQLF_RC_INVAHP                 -5130   /* invalid application heapsz  */
#define SQLF_RC_INVDHP                 -5130   /* invalid database heap size  */
#define SQLF_RC_INVDLT                 -5130   /* invalid deadlock detection  */
#define SQLF_RC_INVTAF                 -5130   /* invalid # of total files    */
                                               /* openper application         */
#define SQLF_RC_INVSHP                 -5130   /* invalid sortlist heap       */
#define SQLF_RC_INVMAL                 -5130   /* invalid maxlocks per        */
                                               /* application                 */
#define SQLF_RC_INVSTMHP               -5130   /* invalid statement heap      */
#define SQLF_RC_INVLOGPRIM             -5130   /* invalid number primary log  */
                                               /* files                       */
#define SQLF_RC_INVLOG2ND              -5130   /* invalid number of           */
                                               /* secondary log files         */
#define SQLF_RC_INVLOGFSZ              -5130   /* invalid log file size       */
#define SQLF_RC_INVDB2                 -5102   /* incompatible file open      */
                                               /* parmeter                    */
#define SQLF_RC_INVK2                  -5104   /* no DB's / requestor only    */
#define SQLF_RC_INVK3                  -5126   /* standalone nodetype does    */
                                               /* notsupport nodename         */
#define SQLF_RC_RWS_EXIST              -5106   /* remote workstation has      */
                                               /* alreadybeen configured      */
#define SQLF_RC_RWS_SYSADM             -5107   /* <authid> does not           */
                                               /* haveauthority to add or     */
                                               /* drop a remote workstation   */
#define SQLF_RC_RWS_NOT_EXIST          -5108   /* remote workstation has      */
                                               /* notbeen previously setup    */
                                               /* using sqlarws               */
#define SQLF_RC_RWS_MACHINENAME        -5109   /* machine name is missing     */
                                               /* ors too long.               */
#define SQLF_RC_RWS_INV_OPT            -5110   /* configuration option is     */
                                               /* invalid                     */
#define SQLF_RC_ENV_VAR_NOTDEF         -5111   /* environment                 */
                                               /* variableDB2WKSTPROF is not  */
                                               /* defined                     */
#define SQLF_RC_INVDB3                 -5146   /* incompatible buffer pool    */
                                               /* and maximum # of            */
                                               /* applications                */
#define SQLF_RC_INV_QUERY_HEAP_SZ      -5143   /* invalid QUERY_HEAP_SZ       */
#define SQLF_RC_INV_RANGE_3            -5144   /* out of range - limited by   */
                                               /* a parm                      */

/* obsolete database manager configuration parameter tokens                   */
#define SQLF_KTN_SVRIOBLK              3
#define SQLF_KTN_SQLENSEG              5
#define SQLF_KTN_COMHEAPSZ             8
#define SQLF_KTN_RSHEAPSZ              9
#define SQLF_KTN_NUMRC                 10
#define SQLF_KTN_CUINTERVAL            14
#define SQLF_KTN_COMHEAPSZ_P           50
#define SQLF_KTN_RSHEAPSZ_P            51
#define SQLF_KTN_IPX_FILESERVER        SQLF_KTN_FILESERVER
#define SQLF_KTN_IPX_OBJECTNAME        SQLF_KTN_OBJECTNAME

/* obsolete database configuration parameter tokens                           */
#define SQLF_DBTN_LOGFILE              4
#define SQLF_DBTN_MAXTOTFILOP          10
#define SQLF_DBTN_LOGEXT               12
#define SQLF_DBTN_LOGMAXEXT            13
#define SQLF_DBTN_AGENTHEAP            14
#define SQLF_DBTN_SEGPAGES             123
#define SQLF_DBTN_BUFFPAGE             2
#define SQLF_DBTN_SORTHEAP             91
#define SQLF_DBTN_SORTHEAPSZ_P         SQLF_DBTN_SORT_HEAP
#define SQLF_DBTN_DBHEAP_P             SQLF_DBTN_DBHEAP
#define SQLF_DBTN_APPLHEAPSZ_P         SQLF_DBTN_APPLHEAPSZ
#define SQLF_DBTN_STMTHEAPSZ_P         SQLF_DBTN_STMTHEAP


/* Repository for obsolete prototypes                                         */

SQL_API_RC SQL_API_FN
  sqlfeudb (
   _SQLOLDCHAR *,                           /* database                       */
   _SQLOLDCHAR *,                           /* password                       */
   unsigned short,                          /* count                          */
   struct sqlfupd *,                        /* list of items                  */
   struct sqlca *);                         /* SQLCA                          */

SQL_API_RC SQL_API_FN                       /* Update Database Configuration  */
  sqlgeudb (
   unsigned short,                          /* reserved                       */
   unsigned short,                          /* database alias length          */
   unsigned short,                          /* number of entries being        */
                                            /* modified                       */
   unsigned short *,                        /* list of item lengths           */
   struct sqlfupd *,                        /* list of items                  */
   struct sqlca *,                          /* SQLCA                          */
   _SQLOLDCHAR *,                           /* reserved                       */
   _SQLOLDCHAR *);                          /* database alias                 */

SQL_API_RC SQL_API_FN                       /* Reset Database Configuration   */
  sqlgrdbc (
   unsigned short,                          /* Spare1                         */
   unsigned short,                          /* Database name length           */
   struct sqlca *,                          /* SQLCA                          */
   _SQLOLDCHAR *,                           /* Spare2                         */
   _SQLOLDCHAR *);                          /* database                       */

SQL_API_RC SQL_API_FN                       /* Return Database Configuration  */
  sqlgxdbc (
   unsigned short,                          /* Spare1                         */
   unsigned short,                          /* Database name length           */
   unsigned short,                          /* count                          */
   struct sqlfupd *,                        /* list of items                  */
   struct sqlca *,                          /* SQLCA                          */
   _SQLOLDCHAR *,                           /* Spare2                         */
   _SQLOLDCHAR *);                          /* Database                       */

/******************************************************************************
** 
** The following functions and symbols are obsolete and may not be supported
** in future releases. The obsolete functions are provided for backward compatibility
** and exported from DB2API.LIB. All applications should be migrated to use new APIs.
** Note: Some of the function parameters may be NO-OP.
** 
*******************************************************************************/
SQL_API_RC SQL_API_FN
  sqlfrdbc (
        _SQLOLDCHAR *,                         /* database                    */
        _SQLOLDCHAR *,                         /* password                    */
        struct sqlca *);                       /* SQLCA                       */

SQL_API_RC SQL_API_FN
  sqlfxdbc (
        _SQLOLDCHAR *,                         /* database alias              */
        _SQLOLDCHAR *,                         /* password                    */
        unsigned short,                        /* count of entries being      */
                                               /* returned                    */
        struct sqlfupd *,                      /* list of items               */
        struct sqlca *);                       /* SQLCA                       */

#define SLQUI_TINTO                    SQLUI_TINTO /* invalid into in         */
                                               /* tcolstrg                    */
/******************************************************************************
** 
** End of obsolete functions and symbols
** 
*******************************************************************************/
#pragma options align=reset

#ifdef __cplusplus 
}
#endif

#endif /* SQL_H_SQLUTIL */
     k. $ $        %  ˸5˸5͸5         k  %      ./usr/lpp/db2_02_01/include/sqluvend.h .                    $          /******************************************************************************
**
** Source File Name: SQLUVEND
**
** (C) COPYRIGHT International Business Machines Corp. 1987, 1995
** All Rights Reserved
** Licensed Materials - Property of IBM
**
** US Government Users Restricted Rights - Use, duplication or
** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
**
** Function = Include File defining:
**              - Interface to vendor devices.
**              - Structures required by vendor interfaces.
**              - Defined symbols and return codes to be
**                returned from vendor interfaces.
**
*******************************************************************************/
#ifndef _H_SQLUVEND
#define _H_SQLUVEND

#ifdef __cplusplus
extern "C" {
#endif

#if (defined(DB2OS2) || defined(DB2NT))
#pragma pack(4)
#elif (defined(DB2WIN))
#pragma pack(2)
#elif (defined(DB2MAC))
#if (defined(DB2PPC))
#pragma align 4
#elif (defined(DB268K))
#pragma align 2
#endif
#elif (defined(DB2HP) || defined(DB2SNI))

#elif (defined(DB2SUN))
#pragma options align=natural
#elif (defined(DB2AIX))
#pragma options align=power
#endif

/******************************************************/
/* This include file is to be used by backup vendors. */
/******************************************************/


#define SQLUV_OK               0   /* Operation is successful */
#define SQLUV_LINK_EXIST       1   /* Session activated previously */
#define SQLUV_COMM_ERROR       2   /* Communication error with device */
#define SQLUV_INV_VERSION      3   /* The DB2 and vendor products are incompatible */
#define SQLUV_INV_ACTION       4   /* Invalid action is requested */
#define SQLUV_NO_DEV_AVAIL     5   /* No device is available for use at the moment */
#define SQLUV_OBJ_NOT_FOUND    6   /* Object specified cannot be found */
#define SQLUV_OBJS_FOUND       7   /* More than 1 object matches specification is found */
#define SQLUV_INV_USERID       8   /* Invalid userid specified */
#define SQLUV_INV_PASSWORD     9   /* Invalid password provided */
#define SQLUV_INV_OPTIONS      10  /* Invalid options specified */
#define SQLUV_INIT_FAILED      11  /* Initialization failed */
#define SQLUV_INV_DEV_HANDLE   12  /* Invalid device handle */
#define SQLUV_BUFF_SIZE        13  /* Invalid buffer size specified */
#define SQLUV_END_OF_DATA      14  /* NOT USED */
#define SQLUV_END_OF_TAPE      15  /* End of tape reached. Requires attention */
#define SQLUV_DATA_RESEND      16  /* Device requested to have last buffer sent again */
#define SQLUV_COMMIT_FAILED    17  /* Commit request failed */
#define SQLUV_DEV_ERROR        18  /* Device error */
#define SQLUV_WARNING          19  /* Warning. see return code */
#define SQLUV_LINK_NOT_EXIST   20  /* Session not activated previously */
#define SQLUV_MORE_DATA        21  /* More data to come */
#define SQLUV_ENDOFMEDIA_NO_DATA   22  /* End of media encountered with no data */
#define SQLUV_ENDOFMEDIA           23  /* ENd of media encountered */
#define SQLUV_MAX_LINK_GRANT   24  /* Max no. of link established */
#define SQLUV_IO_ERROR         25  /* I/O error encountered */
#define SQLUV_DELETE_FAILED    26  /* Delete object fails */
#define SQLUV_INV_BKUP_FNAME   27  /* Invalid backup filename provided */
#define SQLUV_NOT_ENOUGH_SPACE 28  /* insufficient space for estimated database size */
#define SQLUV_ABORT_FAILED     29  /* Abort request failed */

#define SQLUV_COMMIT           0
#define SQLUV_ABORT            1
#define SQLUV_TERMINATE        2    /* For use by ADSM only */

#define SQLUV_COMMENT_LEN     30

typedef struct Return_code
{
        long int   return_code;  /* return code from the vendor function  */
        char       description[SQLUV_COMMENT_LEN];
        /* descriptive message                   */
        void       *reserve;     /* reserve for future use                */
} Return_code;


typedef  struct list_entry
{
    int       entry_len;        /* including null terminator */
    char     *pentry;
} list_entry;

typedef   struct sqlu_gen_list
{
    int                    num_of_entries;
    struct list_entry     *entry;
} sqlu_gen_list;

/* calling action values
*/
#define SQLUV_WRITE       'W'  /* to write */
#define SQLUV_READ        'R'  /* to read  */

typedef struct DB2_info
{
  char     *DB2_id;            /* DB2_id                            */
  char     *version;           /* Current DB2 version               */
  char     *release;           /* Current DB2 release               */
  char     *level;             /* Current DB2 level                 */
  char     *action;            /* Caller action                     */
  char     *filename;          /* file to read or write.            */
  char     *server_id;         /* Unique name identifying db server */
  char     *db2instance;       /* db2insance id                     */
  char     *type;              /* When action is SQLUV_WRITE,       */
                               /*  0 - full database backup         */
                               /*  3 - datapool level backup        */
                               /* When action is SQLUV_READ,        */
                               /*  0 - full restore                 */
                               /*  4 - online tablespace restore    */
                               /*  5 - history file restore         */
                               /*  6 - tablespace table restore     */
                               /*  7 - history file and tablespace  */
  char     *dbname;            /* Database alias to be backed up or */
                               /*   recovered                       */
  char     *alias;             /* Database alias to be backed up or recovered */
  char     *timestamp;         /* Timestamp to identify the backup image */
  char     *sequence;          /* Sequence number within a backup        */

  struct sqlu_gen_list         /* List of objects in the backup     */
                  *obj_list;
  long      max_bytes_per_txn; /* Transfer buffer size want to use  */
  char     *image_filename;    /* Not used.                         */
  void     *reserve;           /* Reserved for future use           */
  char     *nodename;          /* name of node at which the backup  */
                               /* was generated                     */
  char     *password;          /* password for the node at which the */
                               /* backup was generated              */
  char     *owner;             /* backup originator ID              */
  char     *mcNameP;           /* Management Class                  */
} DB2_info ;



typedef struct Vendor_info
{
  char     *vendor_id;         /* An identifier for the vendor      */
  char     *version;           /* Current version                   */
  char     *release;           /* Current release                   */
  char     *level;             /* Current level                     */
  char     *server_id;         /* Unique name identifying db server */
  long      max_bytes_per_txn; /* Vendor supports max bytes / transfer*/
  long      num_objects_in_backup;   /* no. of objects found in backup*/
  void     *reserve;           /* Reserve for future use.           */
} Vendor_info;



typedef struct Init_input
{
   struct DB2_info  *DB2_session;   /* DB2 Identifier for session.  */
   unsigned short   size_options;   /* size of options field.       */
   unsigned long    size_HI_order;  /* High order 32 bits of DB size*/
   unsigned long    size_LOW_order; /* Low order 32 bits of DB size */
   void             *options;       /* options passed in by user.   */
   void             *reserve;       /* reserve for future use.      */
   char             *prompt_lvl;    /* Prompt level                 */
   unsigned short   num_sessions;   /* Number of sessions           */
} Init_input;


typedef struct Init_output
{
   struct Vendor_info * vendor_session; /* Vendor id for the session */
   void               * pVendorCB;      /* vendor control block      */
   void               * reserve;        /* reserve for future use.   */
} Init_output ;

typedef struct Data
{
   long   obj_num;                 /* indicate which obj to be read */
                                   /* It is useful for restore.     */
   long   buff_size;               /* buffer size to be used        */
   long   actual_buff_size;        /* actual bytes read or written  */
   void   *dataptr;                /* Pointer to the data buffer    */
   void   *reserve;                /* reserve for future use        */
} Data;




/* To initialize or link to the device. */
int sqluvint ( struct Init_input   *,
               struct Init_output  *,
               struct Return_code  *);


/* To read data from initialized device. */
int sqluvget ( void *             ,
               struct Data         *,
               struct Return_code  *);


/* To write data to the initialized device. */
int sqluvput ( void *             ,
               struct Data         *,
               struct Return_code  *);


/* To end or unlink the device and free all its related resources. */
int sqluvend ( long int  ,
               void *    ,
               struct Init_output  *,
               struct Return_code  *);


/* To delete a committed session. */
int sqluvdel ( struct Init_input   *,
               struct Init_output  *,
               struct Return_code  *);

#if (defined(DB2OS2) || defined(DB2NT) || defined(DB2WIN))
#pragma pack()
#elif (defined(DB2MAC))
#pragma align
#elif (defined(DB2HP) || defined(DB2SNI))

#elif (defined(DB2AIX) || defined(DB2SUN))
#pragma options align=reset
#endif

#ifdef __cplusplus
}
#endif

#endif
    k
 SQLUII_HEOF                    -3054   /* eof reading first rec in    */
                                               /* IXF                         */
#define SQLUII_HLEN_CONV               -3055   /* length of 'H' rec not       */
                                               /* numeric                     */
#define SQLUII_HLEN_SHORT              -3056   /* first record too short      */
#define SQLUII_HTYP                    -3057   /* first IXF rec is not 'H'    */
#define SQLUII_HID                     -3058   /* no IXF identifier in 'H'    */
#define SQLUII_HVERS                   -3059   /* invalid version field in    */
                                               /* 'H'                         */

#define SQLUII_HCNT                    -3060   /* HCNT in 'H' not numeric     */
#define SQLUII_HSBCP_BAD               -3061   /* SBCP in 'H' not numeric     */
#define SQLUII_HDBCP_BAD               -3062   /* DBCP in 'H' not numeric     */
#define SQLUII_HSBCP_CMP               -3063   /* 'H' SBCP not compat w/data  */
                                               /* SBCP                        */
#define SQLUII_HDBCP_CMP               -3064   /* 'H' DBCP not compat w/data  */
                                               /* DBCP                        */
#define SQLUII_DB_CODEPG               -3065   /* can't get codepages         */
#define SQLUII_TEOF                    -3066   /* eof reading/looking for     */
                                               /* 'T' rec                     */
#define SQLUII_TLEN_CONV               -3067   /* length of 'T' rec not       */
                                               /* numeric                     */
#define SQLUII_TLEN_SHORT              -3068   /* 'T' record is too short     */
#define SQLUII_TTYP                    -3069   /* first non-'A' rec not 'T'   */
                                               /* rec                         */

#define SQLUII_ALEN_BAD                -3070   /* invalid rec length of 'A'   */
                                               /* rec                         */
#define SQLUII_TCONV                   -3071   /* invalid data convention in  */
                                               /* 'T'                         */
#define SQLUII_TFORM                   -3072   /* invalid data format in 'T'  */
#define SQLUII_TMFRM                   -3073   /* invalid machine form in     */
                                               /* 'T'                         */
#define SQLUII_TLOC                    -3074   /* invalid data location in    */
                                               /* 'T'                         */
#define SQLUII_TCCNT                   -3075   /* 'C' rec cnt in 'T' not      */
                                               /* numeric                     */
#define SQLUII_TNAML                   -3076   /* name len fld in 'T' not     */
                                               /* numeric                     */
#define SQLUII_CCNT_HIGH               -3077   /* too many 'C' records        */
#define SQLUII_ALEN_CONV               -3078   /* length of 'A' rec not       */
                                               /* numeric                     */
#define SQLUII_CLEN_CONV               -3079   /* length of 'C' rec not       */
                                               /* numeric                     */

#define SQLUII_CLEN_SHORT              -3080   /* 'C' record is too short     */
#define SQLUII_CTYP                    -3081   /* wrong rec type / 'C'        */
                                               /* expected                    */
#define SQLUII_CEOF                    -3082   /* EOF while processing 'C'    */
                                               /* recs                        */
#define SQLUII_CDRID                   -3083   /* 'D' rec id field not        */
                                               /* numeric                     */
#define SQLUII_CPOSN                   -3084   /* 'D' rec posn field not      */
                                               /* numeric                     */
#define SQLUII_CIDPOS                  -3085   /* 'D' id/position not         */
                                               /* consistent                  */
#define SQLUII_NOCREC_FOR_NONNULL_DBCOL -3086  /* IXF column does not exist   */
#define SQLUII_INVCREC_NONNULL_DBCOL   -3087   /* IXF column not valid        */
#define SQLUII_CRECCOMP_NONNULL_DBCOL  -3088   /* IXF column not compatible   */
#define SQLUII_DTYP                    -3089   /* wrong rec type / 'D'        */
                                               /* expected                    */

#define SQLUII_DLEN_CONV               -3090   /* length of 'D' rec not       */
                                               /* numeric                     */
#define SQLUII_DLEN_RANGE              -3091   /* length of 'D' rec not       */
                                               /* valid                       */
#define SQLUII_DID                     -3092   /* invalid id field in 'D'     */
                                               /* rec                         */
#define SQLUIW_IFILE_INV               -3093   /* import file not valid WSF   */
#define SQLUIW_NNCOL_LOST              -3094   /* DOS non-nullable name not   */
                                               /* found                       */
#define SQLUIW_PCOL_INV                -3095   /* col position out of range   */
#define SQLUIW_UCOLTYP_NONUL           -3096   /* unsup col type - not        */
                                               /* nullable                    */
#define SQLUIW_RECLEN_INV              -3097   /* record length invalid       */
#define SQLUIW_INROW_INV               -3098   /* row number out of range     */
#define SQLUIW_INCOL_INV               -3099   /* col number out of range     */

#define SQLUE_COL_TOOBIG               3100    /* column longer than 254      */
                                               /* chars                       */
#define SQLUE_DATA_CHARDEL             3101    /* column has char delimiter   */
#define SQLUE_DCNUM_HIGH               3102    /* dcol column nbr > tcol      */
                                               /* number                      */
#define SQLUE_DCNUM_LOW                3103    /* dcol column nbr < tcol      */
                                               /* number                      */
#define SQLUE_WARNING                  3107    /* warning message issued      */

#define SQLUI_FEWER_DCOLS_DBCOLS_NULLED 3112   /* extra database cols         */
#define SQLUIC_UNSUPTYP_NULLABLE       3113    /* column will be nulled       */
#define SQLUIC_IGNORED_CHAR            3114    /* character ignored           */
#define SQLUIC_FIELD_TOO_LONG          3115    /* input CSV field too long    */
#define SQLUIC_CF_REQFIELD_MISSING     3116    /* field value missing         */
#define SQLUIC_CFINT2_NULLED           3117    /* smallint field nulled       */
#define SQLUIC_CFINT2_ROWREJ           3118    /* smallint field error        */
#define SQLUIC_CFINT4_NULLED           3119    /* int field nulled            */

#define SQLUIC_CFINT4_ROWREJ           3120    /* int field error             */
#define SQLUIC_CFFLOAT_NULLED          3121    /* float field nulled          */
#define SQLUIC_CFFLOAT_ROWREJ          3122    /* float field error           */
#define SQLUIC_CFDEC_NULLED            3123    /* decimal field nulled        */
#define SQLUIC_CFDEC_ROWREJ            3124    /* decimal field error         */
#define SQLUIC_CFTRUNC                 3125    /* char field truncated        */

#define SQLUIC_CFCHAR_NULLED           3126    /* char field nulled           */
#define SQLUIC_CFCHAR_ROWREJ           3127    /* char field error            */
#define SQLUIC_CFDATETRUNC             3128    /* date field truncated        */
#define SQLUIC_CFDTPAD                 3129    /* date/time/stamp field       */
                                               /* padded                      */

#define SQLUIC_CFTIMETRUNC             3130    /* time field truncated        */
#define SQLUIC_CFSTAMPTRUNC            3131    /* stamp field truncated       */
#define SQLUE_TRUNCATE                 3132    /* char field truncated        */
#define SQLUIC_ROWTOOSHORT             3137    /* not enough columns          */
#define SQLUIC_EOF_IN_CHARDELS         3138    /* end of input data file      */
#define SQLUE_SQLSTPDB_ERR             3139    /* stop using database failed  */

#define SQLUE_WSFLAB_LEN               3142    /* WSF label too big           */
#define SQLUE_CHAR_MTRUNC              3143    /* WSF char type length too    */
                                               /* long                        */
#define SQLUE_CHAR_WTRUNC              3144    /* WSF char type length too    */
                                               /* long                        */
#define SQLUE_CHAR_ITRUNC              3145    /* WSF char truncated at 240   */
#define SQLUE_ROWCT_LARGE              3147    /* row count exceeds 2048      */
#define SQLUE_3148                     3148    /* row not inserted            */

#define SQLUII_TCNTCMP                 3154    /* 'H' hcnt not equal 'T' rec  */
                                               /* ccnt                        */
#define SQLUII_CNAML                   3155    /* invalid name length in 'C'  */
                                               /* rec                         */
#define SQLUII_CNULL                   3156    /* invalid null field in 'C'   */
                                               /* rec                         */
#define SQLUII_CTYPE                   3157    /* invalid type field in 'C'   */
                                               /* rec                         */
#define SQLUII_CSBCP                   3158    /* invalid SBCP field in 'C'   */
                                               /* rec                         */
#define SQLUII_CDBCP                   3159    /* invalid DBCP field in 'C'   */
                                               /* rec                         */

#define SQLUII_CLENG                   3160    /* invalid col len fld in 'C'  */
                                               /* rec                         */
#define SQLUII_CPREC                   3161    /* invalid precision in 'C'    */
                                               /* rec                         */
#define SQLUII_CSCAL                   3162    /* invalid scale field in 'C'  */
                                               /* rec                         */
#define SQLUII_CFLOAT_BLANKLENG        3163    /* use 00008 for float col     */
                                               /* length                      */
#define SQLUII_CFLOAT_BADLENG          3164    /* invalid float col len in    */
                                               /* 'C'.                        */
#define SQLUII_CUTYPE                  3165    /* 'C' record has invalid      */
                                               /* type                        */
#define SQLUII_NOCREC_FOR_NULL_DBCOL   3166    /* IXF col does not exist      */
#define SQLUII_INVCREC_FOR_NULL_DBCOL  3167    /* IXF col is invalid          */
#define SQLUII_CRECCOMP_NULL_DBCOL     3168    /* IXF col not compatible      */

#define SQLUII_DEOF_INROW              3170    /* EOF found in row of data    */
#define SQLUIW_NONLAB_HDR              3171    /* non-label cell in hdr row   */
#define SQLUIW_NCOL_LOST               3172    /* nullable colnam not found   */
#define SQLUIW_UCOLTYP_NULL            3174    /* unsup col type - nullable   */
#define SQLUIW_INTYPE_INV              3175    /* wrong rec type for db col   */
#define SQLUIW_DATE_INV                3176    /* date value out of range     */
#define SQLUIW_TIME_INV                3177    /* time value out of range     */
#define SQLUIW_INTIME_INV              3178    /* int rec for time invalid    */
#define SQLUIW_NODATA_NNULL            3179    /* no data / non nullable col  */

#define SQLUE_INSERT_DISK              3180    /* insert diskette request     */
#define SQLUII_AE_NOTFOUND             3181    /* file ended before AE rec    */
#define SQLUII_INSERT_DISK_RETRY       3182    /* retry to insert diskette    */
#define SQLUEC_NOBLANK_B4KW            3183    /* mult del o'rides/no blanks  */
#define SQLUI_PREVMESG_ROWNO           3185    /* row of previous warning     */
#define SQLUI_LOGFULL_INSWARN          3186    /* log full inserting row      */
#define SQLUI_INDEX_WARN               3187    /* error creating index        */
#define SQLUI_TRUNCATE_TABLE           -3188   /* error truncating table      */

#define SQLUI_INDEXIXF                 -3190   /* invalid INDEXIXF option     */
#define SQLUI_VIEW_ERROR               -3193   /* cannot import to this view  */
#define SQLUI_SYSTBL_ERROR             -3194   /* cannot import system table  */
#define SQLUE_RETRY_DISK               3195    /* not enough space            */
#define SQLUI_IN_NOTFD                 -3196   /* input file not found        */
#define SQLUI_IMPBUSY                  -3197   /* import/export in use        */

#define SQLUI_REPL_PAR                 -3201   /* cant replace parent table   */
#define SQLUI_IUOPT_NOPK               -3203   /* cant update without PK's    */
#define SQLUI_IUOPT_NOVIEW             -3204   /* cant update views           */
#define SQLUI_VIEW_REF                 -3205   /* cant replace ref cons view  */
#define SQLUI_VIEW_SQUERY              -3206   /* cant replace subquery view  */

#define SQLUE_PROVIDE_FILE_PART        3220    /* AIX req next file           */
#define SQLUI_START_COMMIT             3221    /* start commit                */
#define SQLUI_FINISH_COMMIT            3222    /* finish commit               */
#define SQLUI_BAD_STRUCT_PARM          -3223   /* bad input parms             */
#define SQLUI_SKIPPED_ALL_ROWS         -3225   /* restartcnt too big          */
#define SQLUI_COMPOUND_ERR             -3250   /* compound=x error            */

#define SQLUIW_RCSEQ_INV               -3300   /* row/col sequence invalid    */
#define SQLUIW_BOF_INV                 -3301   /* BOF in middle of WSF file   */
#define SQLUIW_EARLY_EOF               -3302   /* unexpected EOF              */
#define SQLUI_IXFONLY                  -3303   /* filetype not ixf            */
#define SQLUI_DELTABLE                 -3304   /* table does not exist        */
#define SQLUI_CREATE_ERR               -3305   /* table already exists        */
#define SQLUI_EXECUTE_ERR              -3306   /* SQL error during insert     */
#define SQLUI_INC_COL                  -3307   /* incomplete col info         */
#define SQLUI_CP_MISMATCH              -3308   /* codepage mismatch           */
#define SQLUI_DBLDATA                  -3309   /* double byte data found      */

#define SQLUI_UNREC_CTYPE              -3310   /* unrec col type              */
#define SQLUI_INVCREC_FOR_CREATE       -3310   /* invalid IXF column          */

#define SQLUE_DISK_FULL_DB2OS2         -3313   /* disk full - OS/2            */
#define SQLUE_DISK_FULL_DB2NT          -3313   /* disk full - Windows NT      */
#define SQLUE_DISK_FULL_DB2DOS         -3313   /* disk full - DOS             */
#define SQLUE_DISK_FULL_DB2WIN         -3313   /* disk full - Windows         */
#define SQLUE_DISK_FULL_DB2AIX         -10018  /* disk full - AIX             */
#define SQLUE_DISK_FULL_DB2MAC         -3313   /* disk full - MacOS           */

#define SQLUE_DISK_FULL                SQLUE_DISK_FULL_DB2AIX

#define SQLUII_ASTAMP_NOMATCH          -3314   /* 'A' data/ time not as 'H'.  */
#define SQLUII_ACREC_BADVOL            -3315   /* invalid volume info         */
#define SQLUII_CLOSE_NOTLAST           -3316   /* error closing IXF file      */
#define SQLUW_FTMOD_INV                -3317   /* conflict in filetmod        */
#define SQLUEC_DUP_KEYWORD             -3318   /* keyword repeated/filetmod   */
#define SQLUI_ERR_CREATETAB            -3319   /* error creating table        */

#define SQLUEC_NOROOM_AFTERKW          -3320   /* keyword at end of filetmod  */
#define SQLUI_LOGFULL_INSERR           -3321   /* circular log full           */
#define SQLUE_SEM_ERROR                -3322   /* semaphore error             */
#define SQLUE_INVCOLTYPE               -3324   /* column type invalid         */
#define SQLUEW_IGNORED_ROW             3325    /* ignored WSF row             */
#define SQLUI_COL_LIST                 -3326   /* column list invalid         */
#define SQLUEI_SYSERROR                -3327   /* system error                */

#define SQLUII_ODD2GRAPH               3330    /* odd leng char -> graphic    */
#define SQLUE_OEACCESS                 -3331   /* permission denied           */
#define SQLUE_OEMFILE                  -3332   /* too many files open         */
#define SQLUE_OENOENT                  -3333   /* no such file or directory   */
#define SQLUE_OENOMEM                  -3334   /* not enough memory           */
#define SQLUE_OENOSPC                  -3335   /* no space left               */

#define SQLUIA_BAD_DCOL_METH           -3400   /* invalid method for ASC      */
#define SQLUI_DCOLM_ALL                -3401   /* invalid import method       */
#define SQLUIA_NULLLOC                 -3402   /* zeroes as begin/end         */
#define SQLUIA_LOCPAIR                 -3403   /* invalid pair                */
#define SQLUIA_LOCNUM                  -3404   /* invalid pair for number     */
#define SQLUIA_LOCDATE                 -3405   /* invalid pair for date       */
#define SQLUIA_LOCTIME                 -3406   /* invalid pair for time       */
#define SQLUIA_LOCSTAMP                -3407   /* invalid pair for timestamp  */
#define SQLUIA_LOCLONG                 3408    /* pair defines long field     */
#define SQLUIA_LOCSHORT                3409    /* pair defines short field    */
#define SQLUIA_LOCODD                  -3410   /* invalid pair for graphic    */
#define SQLUIA_CFGRAPH_NULLED          3411    /* value not graphic--null     */
#define SQLUIA_CFGRAPH_ROWREJ          3412    /* value not graphic--not      */
                                               /* null                        */
#define SQLUIA_SHORTFLDNULLED          3413    /* field too short--nulled     */

#define SQLU_TOO_MANY_WARNINGS         3502    /* number of warnings hit      */
                                               /* threshold                   */
#define SQLU_ROWCNT                    3503    /* number of rows hit          */
                                               /* threshold                   */
#define SQLULA_INVALID_RECLEN          -3505   /* reclen > 32767              */
#define SQLULA_NULLIND_IGNORED         3506    /* null ind value not Y or N   */
#define SQLUI_NULLIND                  -3507   /* nullind column is invalid   */
#define SQLUL_FILE_ERROR               -3508   /* file access error during    */
                                               /* load                        */
#define SQLUL_NUM_ROW_DELETED          3509    /* num of row deleted after    */
                                               /* load                        */
#define SQLU_SORT_WORK_DIR_ERROR       -3510   /* work directory is invalid   */
#define SQLU_NB_LOBFILE_MISSING        3511    /* lobfile missing but         */
                                               /* nullable col                */
#define SQLU_NNB_LOBFILE_MISSING       3512    /* lobfile missing,            */
                                               /* nonnullable col             */
#define SQLUL_UNMATCHED_CODEPAGE       -3513   /* codepage doesn't match db   */
#define SQLUL_SYSERR_WITH_REASON       -3514   /* system error with reason    */
                                               /* code                        */
#define SQLUL_UNEXPECTED_RECORD        -3517   /* unexpected rec in db2cs     */
#define SQLUL_INCOMPATIBLE_TABLE       -3518   /* coltype incompatible for    */
                                               /* db2cs                       */
#define SQLUL_FILE_NOT_FOUND           -3521   /* missing file                */
#define SQLUL_COPY_LOGRETAIN_OFF       -3522   /* copy spec, no logretain     */
                                               /* userexit                    */
#define SQLUL_NO_MESSAGES              3523    /* no messages to be           */
                                               /* retrieved                   */
#define SQLUL_FREESPACE_OPT            -3524   /* freespace option invalid    */
#define SQLU_INCOMPAT_OPT              -3525   /* incompatible options        */
#define SQLU_NEXT_TAPE_WARNING         3700    /* mount new tape              */
#define SQLU_LOBPATHS_IGNORED          3701    /* no lobs/longs but lobpath   */
                                               /* nonull                      */
#define SQLU_DEVICE_IGNORED            3702    /* device error but ignored    */
#define SQLU_NUM_BUFFERS               -3704   /* invalid number of buffers   */
#define SQLU_BUFFER_SIZE_ERROR         -3705   /* invalid load/unload buffer  */
                                               /* size                        */
#define SQLUL_DISK_FULL                -3706   /* copy target full            */
#define SQLU_SORT_BUFFSIZE_ERROR       -3707   /* invalid sort buffer size    */

/* Load / unload / load recovery SQLCODES                                     */
#define SQLU_OPEN_COPY_LOC_FILE_ERROR  -3783
#define SQLU_INV_COPY_LOC_FILE_INPUT   -3784
#define SQLU_LOAD_RECOVERY_FAILED      -3785
#define SQLU_INVALID_PARM_WARNING      3798
#define SQLU_LOAD_RECOVERY_PENDING     3799

/* load recovery - copy location input error type                             */
#define SQLU_KEYWORD_CODE              1
#define SQLU_OVERRIDE_CODE             2
#define SQLU_UNEXPECTED_EOF_CODE       3
#define SQLU_IOERROR_CODE              4

/* Loadapi SQLCODES                                                           */
#define SQLU_INVALID_QUIESCEMODE       -3802
#define SQLU_INVALID_INDEX             -3804
#define SQLU_INVALID_LOADAPI_ACTION    -3805
#define SQLU_CONSTRAINTS_NOT_OFF       -3806
#define SQLU_NO_LIFEBOAT               -3414

/* Export SQLCODES                                                            */
#define SQLUE_MSG                      -3999   /* Export message              */

/* Roll-Forward Recovery SQLCODES                                             */
#define SQLU_INVALID_PARAM             -4904   /* invalid parameter           */
#define SQLU_INVALID_RANGE             -4905   /* invalid parameter range     */

/* Configuration SQLCODES                                                     */
#define SQLF_RC_SYSAUTH                -5001   /* only SYSADM_GROUP can       */
                                               /* change db2 configuration    */
                                               /* file                        */
#define SQLF_RC_SYSERR                 -5005   /* system error                */
#define SQLF_RC_PATHNAME               -5010   /* path name error             */
#define SQLF_RC_INVNODENAME            -5020   /* invalid node name           */
#define SQLF_RC_INVSYSIDX              -5021   /* invalid system flag         */
#define SQLF_RC_INVDBIDX               -5022   /* invalid database flag       */
#define SQLF_RC_KCON                   -5025   /* not current db2             */
                                               /* configuration               */
#define SQLF_RC_INVSYSADM              -5028   /* invalid sysadm_group        */
#define SQLF_RC_REL                    -5030   /* invalid release number      */
#define SQLF_RC_NEEDMIG                -5035   /* database needs migration;   */
                                               /* release number is back      */
                                               /* level                       */

#define SQLF_RC_INSMEM                 -5047   /* insufficient memory to      */
                                               /* support stack switching     */
#define SQLF_RC_SYSCSUM                -5050   /* invalid db2 configuration   */
                                               /* file                        */
#define SQLF_RC_DBCSUM                 -5055   /* invalid db configuration    */
                                               /* file                        */
#define SQLF_RC_INVTKN                 -5060   /* invalid token parameter     */
#define SQLF_RC_INVTKN_STRUCT          -5061   /* invalid ptr to sqlfupd      */
#define SQLF_RC_INVTKN_PTR             -5062   /* invalid token ptr value     */
#define SQLF_RC_INVNT                  -5065   /* invalid node type           */
#define SQLF_RC_CNTINV                 -5070   /* invalid count parameter     */
#define SQLF_RC_CNTBRK                 -5075   /* interrupt received          */
#define SQLF_RC_INVILF                 -5083   /* invalid initial log size    */

#define SQLF_RC_INVLFE                 -5091   /* invalid logfile extention   */
#define SQLF_RC_INVNLE                 -5092   /* invalid # of log extention  */
#define SQLF_RC_INVNEWLOGP             -5099   /* invalid new log path        */

#define SQLF_RC_INVDB1                 -5101   /* incompatible logfile        */
                                               /* parameter                   */
#define SQLF_RC_INV_BIT_VALUE          -5112   /* invalid bit value - must    */
                                               /* be 0 or 1                   */

#define SQLF_RC_LF_1_3                 -5120   /* both R1 & R3 Log            */
                                               /* parameters may not be       */
                                               /* modified                    */
#define SQLF_RC_INVDETS                -5121   /* invalid DB configuration    */
                                               /* details                     */
#define SQLF_RC_PROTECT                -5122   /* database is copy protected  */
#define SQLF_RC_LOGIO                  -5123   /* I/O Error with log header   */
#define SQLF_RC_INV_DBMENT             -5126   /* invalid db2 config file     */
                                               /* entry                       */
#define SQLF_RC_INV_RANGE              -5130   /* integer out of range        */
#define SQLF_RC_INV_RANGE_2            -5131   /* integer out of range (-1)   */
#define SQLF_RC_INV_STRING             -5132   /* string null or too long     */
#define SQLF_RC_INV_SET                -5133   /* char/int not in set         */
#define SQLF_RC_INVTPNAME              -5134   /* tpname not valid            */
#define SQLF_RC_LOW_APPLS_AND_LOCKS    -5135   /* maxappls*maxlocks too low   */
#define SQLF_RC_INV_DBPATH             -5136   /* dftdbpath not valid         */
#define SQLF_RC_INV_DIAGPATH           -5137   /* diagpath not valid          */
#define SQLF_RC_MAX_ITEMS_EXCEEDED     -5139   /* To many items on update or  */
                                               /* get                         */
#define SQLF_RC_INV_AUTHENTICATION     -5140   /* invalid authentication      */
#define SQLF_RC_INV_AVG_APPLS          -5141   /* invalid AVG_APPLS           */
#define SQLF_RC_INV_AGENTPRI           -5131   /* invalid agent priority      */
#define SQLF_RC_INV_RANGE_MAX_EXPR     -5144   /* out of range - maximum      */
                                               /* limited by an expression    */
#define SQLF_RC_INV_RANGE_MAX_EXPR_2   -5145   /* out of range - maximum      */
                                               /* limited by an expression    */
                                               /* (range includes -1)         */
#define SQLF_RC_INV_RANGE_MIN_EXPR     -5146   /* out of range - minimum      */
                                               /* limited by an expression    */
#define SQLF_RC_INV_RANGE_MIN_EXPR_2   -5147   /* out of range - minimum      */
                                               /* limited by an expression    */
                                               /* (range includes -1)         */

/* Repository for obsolete Return Codes                                       */

#define SQLU_WRITE_ERROR               -2006   /* wrote wrong # of bytes      */
#define SQLU_CONNECT_ERROR             -2010   /* error in Start Using        */
#define SQLU_INT_ERROR                 -2012   /* error in ints               */
#define SQLUD_NO_MHEADER_ERROR         -2531   /* media header not present    */
#define SQLUD_NO_MHEADER_WARNING       2534    /* media header missing        */
#define SQLUD_NEXT_TAPE_WARNING        2535    /* another tape mount          */
                                               /* required                    */
#define SQLUD_ADSM_MOUNT_WAIT          2545    /* waiting for ADSM server to  */
                                               /* access data on removable    */
                                               /* media                       */

/******************************************************************************
** Configuration parameter obsolete return codes defines -  
** Some configuration parameters had specific out of range return
** codes; these have been replaced by generic out of range messages
** In these cases the old token names for the specific return codes
** are given, but the values are replaced by the new values returned 
** when out of range.
*******************************************************************************/

#define SQLF_RC_DBAUTH                 -5002   /* only SYSADM can             */
                                               /* changedatabase              */
                                               /* configuration file          */
#define SQLF_RC_INVNDB                 -5130   /* invalid # of concurrent db  */
#define SQLF_RC_INVRIO                 -5130   /* invalid req I/O blk size    */
#define SQLF_RC_INVSIO                 -5015   /* invalid serv I/O blk size   */
#define SQLF_RC_INVCHEAP               -5016   /* invalid communications      */
                                               /* heap                        */
#define SQLF_RC_INVRSHEAP              -5017   /* invalid remote services     */
                                               /* heap                        */
#define SQLF_RC_INVSHPTHR              -5130   /* invalid sort heap           */
                                               /* threshold                   */
#define SQLCC_RC_BAD_DB2COMM           -5036   /* invalid DB2COMM value       */
#define SQLCC_RC_NO_SERV_IN_DBMCFG     -5037   /* service name not definein   */
                                               /* db2 config file             */
#define SQLCC_RC_SERV_NOT_FOUND        -5038   /* service name not found in   */
                                               /* etc/services file           */
#define SQLCC_RC_INT_PORT_NOT_FOUND    -5039   /* interrupt port not found    */
                                               /* in/etc/services file        */
#define SQLCC_RC_SOCKADDR_IN_USE       -5040   /* socket address in use       */
#define SQLCC_RC_NO_TPN_IN_DBMCFG      -5041   /* trans program name not      */
                                               /* definedin db2               */
                                               /* configuration file          */
#define SQLCC_RC_COMM_SUPPORT_FAILED   -5042   /* general failure in          */
                                               /* servercommunications        */
                                               /* support                     */
#define SQLF_RC_INVNLL                 -5130   /* invali