Application Development Guide
The host-language specific include files for FORTRAN have the file
extension .f on UNIX platforms, and .for on OS/2. You can use
the following FORTRAN include files in your applications.
- SQL (sql.f)
- This file includes language-specific prototypes for the binder,
precompiler, and error message retrieval APIs. It also defines system
constants.
- SQLAPREP (sqlaprep.f)
- This file contains definitions required to write your own
precompiler.
- SQLCA (sqlca_cn.f, sqlca_cs.f)
- This file defines the SQL Communication Area (SQLCA) structure. The
SQLCA contains variables that are used by the database manager to provide an
application with error information about the execution of SQL statements and
API calls.
Two SQLCA files are provided for FORTRAN applications. The default,
sqlca_cs.f, defines the SQLCA structure in an IBM SQL
compatible format. The sqlca_cn.f file,
precompiled with the SQLCA NONE option, defines the SQLCA structure
for better performance.
- SQLCA_92 (sqlca_92.f)
- This file contains a FIPS SQL92 Entry Level compliant version of the SQL
Communications Area (SQLCA) structure. This file should be included in
place of either the sqlca_cn.f or the
sqlca_cs.f files when writing DB2 applications that
conform to the FIPS SQL92 Entry Level standard. The
sqlca_92.f file is automatically included by the DB2
precompiler when the LANGLEVEL precompiler option is set to SQL92E.
- SQLCODES (sqlcodes.f)
- This file defines constants for the SQLCODE field of the SQLCA
structure.
- SQLDA (sqldact.f)
- This file defines the SQL Descriptor Area (SQLDA) structure. The
SQLDA is used to pass data between an application and the database
manager. See Allocating an SQLDA Structure for details of how to code an SQLDA in a FORTRAN
program.
- SQLEAU (sqleau.f)
- This file contains constant and structure definitions required for the DB2
security audit APIs. If you use these APIs, you need to include this
file in your program. This file also contains constant and keyword
value definitions for fields in the audit trail record. These
definitions can be used by external or vendor audit trail extract
programs.
- SQLENV (sqlenv.f)
- This file defines language-specific calls for the database environment
APIs, and the structures, constants, and return codes for those
interfaces.
- SQLE819A (sqle819a.f)
- If the code page of the database is 819 (ISO Latin-1), this sequence sorts
character strings that are not FOR BIT DATA according to the host CCSID 500
(EBCDIC International) binary collation. This file is used by the
CREATE DATABASE API.
- SQLE819B (sqle819b.f)
- If the code page of the database is 819 (ISO Latin-1), this sequence sorts
character strings that are not FOR BIT DATA according to the host CCSID 037
(EBCDIC US English) binary collation. This file is used by the CREATE
DATABASE API.
- SQLE850A (sqle850a.f)
- If the code page of the database is 850 (ASCII Latin-1), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
500 (EBCDIC International) binary collation. This file is used by the
CREATE DATABASE API.
- SQLE850B (sqle850b.f)
- If the code page of the database is 850 (ASCII Latin-1), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
037 (EBCDIC US English) binary collation. This file is used by the
CREATE DATABASE API.
- SQLE932A (sqle932a.f)
- If the code page of the database is 932 (ASCII Japanese), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
5035 (EBCDIC Japanese) binary collation. This file is used by the
CREATE DATABASE API.
- SQLE932B (sqle932b.f)
- If the code page of the database is 932 (ASCII Japanese), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
5026 (EBCDIC Japanese) binary collation. This file is used by the
CREATE DATABASE API.
- SQL1252A (sql1252a.f)
- If the code page of the database is 1252 (Windows Latin-1), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
500 (EBCDIC International) binary collation. This file is used by the
CREATE DATABASE API.
- SQL1252B (sql1252b.f)
- If the code page of the database is 1252 (Windows Latin-1), this sequence
sorts character strings that are not FOR BIT DATA according to the host CCSID
037 (EBCDIC US English) binary collation. This file is used by the
CREATE DATABASE API.
- SQLMON (sqlmon.f)
- This file defines language-specific calls for the database system monitor
APIs, and the structures, constants, and return codes for those
interfaces.
- SQLSTATE (sqlstate.f)
- This file defines constants for the SQLSTATE field of the SQLCA
structure.
- SQLUTIL (sqlutil.f)
- This file defines the language-specific calls for the utility APIs, and
the structures, constants, and codes required for those interfaces.
There are two methods for including files: the EXEC SQL INCLUDE
statement and the FORTRAN INCLUDE statement. The precompiler will
ignore FORTRAN INCLUDE statements, and only process files included with the
EXEC SQL statement.
To locate the INCLUDE file, the DB2 FORTRAN precompiler searches the
current directory first, then the directories specified by the DB2INCLUDE
environment variable. Consider the following examples:
- EXEC SQL INCLUDE payroll
If the file specified in the INCLUDE statement is not enclosed in quotation
marks, as above, the precompiler searches for payroll.sqf,
then payroll.f (payroll.for on OS/2) in
each directory in which it looks.
- EXEC SQL INCLUDE 'pay/payroll.f'
If the file name is enclosed in quotation marks, as above, no extension is
added to the name. (For OS/2, the file would be specified as
'pay\payroll.for'.)
If the file name in quotation marks does not contain an absolute path, then
the contents of DB2INCLUDE are used to search for the file, prepended to
whatever path is specified in the INCLUDE file name. For example, with
DB2 for AIX, if DB2INCLUDE is set to
'/disk2:myfiles/fortran', the precompiler searches
for './pay/payroll.f', then
'/disk2/pay/payroll.f', and finally
'./myfiles/cobol/pay/payroll.f'. The
path where the file is actually found is displayed in the precompiler
messages. On OS/2, substitute back slashes (\) for the forward
slashes, and substitute 'for' for the
'f' extension in the above example.
Note: | The setting of DB2INCLUDE is cached by the DB2 Command Line Processor.
To change the setting of DB2INCLUDE after any CLP commands have been issued,
enter the TERMINATE command, then reconnect to the database and precompile as
usual.
|
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]