Command Reference
Processes an application program source file containing embedded SQL
statements. A modified source file is produced containing host language calls
for the SQL statements and, by default, a package is created in the database.
Scope
This command can be issued from any node in db2nodes.cfg. It
updates the database catalogs on the catalog node. Its effects are visible to
all nodes.
Authorization
One of the following:
- sysadm or dbadm authority
- BINDADD privilege if a package does not exist and one of:
- IMPLICIT_SCHEMA authority on the database if the schema name of the
package does not exist
- CREATEIN privilege on the schema if the schema name of the package exists
- ALTERIN privilege on the schema if the package exists
- BIND privilege on the package if it exists.
The user also needs all privileges required to compile any static SQL
statements in the application. Privileges granted to groups are not used for authorization checking
of static statements. If the user has sysadm authority, but not explicit
privileges to complete the bind, the database manager grants explicit
dbadm authority automatically.
Required Connection
Database. If implicit connect is enabled, a connection to the default
database is established.
Command Syntax
For DB2
>>-+-PRECOMPILE-+filename---+--------------------------------+-->
+-+------+---+ +-BINDFILE--+-------------------++
+-PREP-+ +-USING--bind-file--+
>--+----------------------+-+--------------------------+-------->
| +-UNAMBIG-+| +-COLLECTION--schema-name--+
+-BLOCKING--+-ALL-----++
+-NO------+
>--+---------+-+------------------+-+--------------------------+>
+-CONNECT-+ | +-DEF-+| | +-NO--+|
| +-1-+ | +-DATETIME--+-EUR-++ +-DEFERRED_PREPARE--+-ALL-++
+-+-2-+---+ +-ISO-+ +-YES-+
+-JIS-+
+-LOC-+
+-USA-+
>--+-----------------------------------+--+------------------+-->
+-DEGREE--+-1---------------------+-+ +-DISCONNECT-------+
+-degree-of-parallelism-+ | +-EXPLICIT----+ |
+-ANY-------------------+ +-+-AUTOMATIC---+--+
+-CONDITIONAL-+
>--+-----------------+-+------------------+-+-----------------+->
| +-NO--+| | +-NO--+| +-FUNCPATH--------+
+-EXPLAIN--+-ALL-++ +-EXPLSNAP--+-ALL-++ | +-,-----------+ |
+-YES-+ +-YES-+ | V | |
+--schema-name--+-+
>--+-----------------+--+------------------+-------------------->
| +-DEF-+ | | +-CS-+|
+-INSERT--+-BUF-+-+ +-ISOLATION--+-RR-++
+-RS-+
+-UR-+
>--+----------------------+-+-------------------------+--------->
| +-SAA1---+| +-MESSAGES--message-file--+
+-LANGLEVEL--+-MIA----++
+-SQL92E-+
>--+--------------+--+----------+-+-------------------+--------->
+-NOLINEMACRO--+ +-OPTLEVEL-+ +-OUTPUT--filename--+
| +-0-+ |
+-+-1-+----+
>--+----------------------------------+-+--------------------+-->
+-PACKAGE--+----------------------++ +-QUERYOPT-----------+
+-USING--package-name--+ +-optimization-level-+
>--+----------------+------------------------------------------->
| +-SAA--+|
+-SQLCA--+-NONE-++
>--+-------------------------------------------------------------------+->
| SYNTAX is a synonym for SQLERROR(CHECK). +-NOPACKAGE-+ |
+-------------------------------------------SQLERROR--+-CHECK-----+-+
>--+----------------+-+-------------------+--------------------->
+-SQLFLAG--------+ | +-DB2-+ |
+-+-SQL92E----+--+ +-SQLRULES--+-STD-+-+
| +-MVSDB2V23-+ |
| +-MVSDB2V31-+ |
| +-MVSDB2V41-+ |
+---SYNTAX-------+
>--+------------------+--+---------------+-+--------+----------->
| +-YES-+ | +-SYNCPOINT-----+ +-SYNTAX-+
+-SQLWARN--+-NO--+-+ | +-ONEPHASE-+ |
+-+-NONE-----+--+
+-TWOPHASE-+
>--+-------------------------------+--+----------------+-------><
| +-IBMCOB------------+ | +-WCHARTYPE------+
+-TARGET--+-MFCOB-------------+-+ | +-NOCONVERT-+ |
+-MFCOB16-----------+ +-+-CONVERT---+--+
+-ANSI_COBOL--------+
+-C-----------------+
+-CPLUSPLUS---------+
+-FORTRAN-----------+
+-BORLAND_C---------+
+-BORLAND_CPLUSPLUS-+
|
For DRDA
>>-+-PRECOMPILE-+filename--------------------------------------->
+-+------+---+
+-PREP-+
>--+----------------------------------------------------------------+>
+-ACTION--+-ADD-------------------------------------------------++
+-REPLACE--+----------------+-+----------------------++
+-RETAIN--+-NO--++ +-REPLVER--version-id--+
+-YES-+
>--+--------------------------------+-+----------------------+-->
+-BINDFILE--+-------------------++ | +-UNAMBIG-+|
+-USING--bind-file--+ +-BLOCKING--+-ALL-----++
+-NO------+
>--+-----------------------+-+----------------------+----------->
+-CCSIDG--double-ccsid--+ +-CCSIDM--mixed-ccsid--+
>--+---------------------+-+---------------------+-------------->
+-CCSIDS--sbcs-ccsid--+ | +-DEFAULT-+|
+-CHARSUB--+-BIT-----++
+-MIXED---+
+-SBCS----+
>--+--------------------------+--+---------------+-------------->
+-COLLECTION--schema-name--+ | +-1-+|
+-CONNECT--+-2-++
>--+------------------+-+------------+-+-------------------+---->
| +-DEF-+| +-DEC--+-15-++ +-DECDEL--+-COMMA--++
+-DATETIME--+-EUR-++ +-31-+ +-PERIOD-+
+-ISO-+
+-JIS-+
+-LOC-+
+-USA-+
>--+--------------------------+--------------------------------->
| +-NO--+|
+-DEFERRED_PREPARE--+-ALL-++
+-YES-+
>--+-------------------------------------------------------------------------------------------------------------+->
| The DEGREE option is only supported by DRDA Level 2 Application Servers. |
+---------------------------------------------------------------------------DEGREE--+-1---------------------+-+
+-degree-of-parallelism-+
+-ANY-------------------+
>--+----------------------------+-+-----------------------+----->
| +-EXPLICIT----+| | +-RUN--+|
+-DISCONNECT--+-AUTOMATIC---++ +-DYNAMICRULES--+-BIND-++
+-CONDITIONAL-+
>--+-----------------+-+------------------+--------------------><
| +-NO--+| | +-CS-+|
+-EXPLAIN--+-YES-++ +-ISOLATION--+-NC-++
+-RR-+
+-RS-+
+-UR-+
|
>>-+---------------------------+-+-------------------------+---->
+-LEVEL--consistency-token--+ +-MESSAGES--message-file--+
>--+--------------+--+----------+------------------------------->
+-NOLINEMACRO--+ +-OPTLEVEL-+
| +-0-+ |
+-+-1-+----+
>--+------------------------------+----------------------------->
+----OWNER---authorization-id--+
>--+----------------------------------+------------------------->
+-PACKAGE--+----------------------++
+-USING--package-name--+
>--+--------------------------------+-+------------------------+>
+----QUALIFIER---qualifier-name--+ | +-COMMIT-----+|
+-RELEASE--+-DEALLOCATE-++
>--+-------------------------------------------------------------------+->
| SYNTAX is a synonym for SQLERROR(CHECK). +-NOPACKAGE-+ |
+-------------------------------------------SQLERROR--+-CHECK-----+-+
+-CONTINUE--+
>--+----------------+-+----------+-+-----------------------+---->
+-SQLFLAG--------+ +-SQLRULES-+ +-STRDEL--+-APOSTROPHE-++
+-+-SQL92E----+--+ | +-DB2-+ | +-QUOTE------+
| +-MVSDB2V23-+ | +-+-STD-+--+
| +-MVSDB2V31-+ |
| +-MVSDB2V41-+ |
+---SYNTAX-------+
>--+---------------+-+--------+--------------------------------->
+-SYNCPOINT-----+ +-SYNTAX-+
| +-ONEPHASE-+ |
+-+-NONE-----+--+
+-TWOPHASE-+
>--+-------------------------------+--+--------------+---------->
| +-IBMCOB------------+ | +-TEXT--label--+
+-TARGET--+-MFCOB-------------+-+
+-MFCOB16-----------+
+-ANSI_COBOL--------+
+-C-----------------+
+-CPLUSPLUS---------+
+-FORTRAN-----------+
+-BORLAND_C---------+
+-BORLAND_CPLUSPLUS-+
>--+-------------------+-+----------------------+--------------->
| +-RUN--+| +-VERSION--version-id--+
+-VALIDATE--+-BIND-++
>--+-------------------------+---------------------------------><
| +-NOCONVERT-+|
+-WCHARTYPE--+-CONVERT---++
|
Command Parameters
- filename
- Specifies the source file to be precompiled. An extension of:
- .sqc must be specified for C applications (generates a
.c file)
- .sqx (OS/2 or the Windows operating system), or
.sqC (UNIX based systems) must be specified for
C++ applications (generates a .cxx file on
OS/2 or the Windows operating system, or a .C file on
UNIX based systems)
- .sqb must be specified for COBOL applications (generates
a .cbl file)
- .sqf must be specified for FORTRAN applications
(generates a .for file on OS/2 or the Windows
operating system, or a .f file on UNIX based systems).
- ACTION
- Indicates whether the package can be added or replaced. This DRDA
precompile/bind option is not supported by DB2.
- ADD
- Indicates that the named package does not exist, and that a new package is
to be created. If the package already exists, execution stops, and a
diagnostic error message is returned.
- REPLACE
- Indicates that the old package is to be replaced by a new one with the
same location, collection, and package name.
- RETAIN
- Indicates whether EXECUTE authorities are to be preserved when a package
is replaced. If ownership of the package changes, the new owner grants the
BIND and EXECUTE authority to the previous package owner.
- NO
- Does not preserve EXECUTE authorities when a package is replaced.
- YES
- Preserves EXECUTE authorities when a package is replaced.
- REPLVER version-id
- Replaces a specific version of a package. The version identifier specifies
which version of the package is to be replaced. Maximum length is 254
characters.
- BINDFILE
- Results in the creation of a bind file. A package is not created unless
the package option is also specified. If a bind file is requested,
but no package is to be created, as in the following example:
db2 prep sample.sqc bindfile
object existence and authentication SQLCODEs will be treated as
warnings instead of errors. This will allow a bind file to be successfully
created, even if the database being used for precompilation does not have all
of the objects referred to in static SQL statements within the application.
The bind file can be successfully bound, creating a package, once the required
objects have been created.
- USING bind-file
- The name of the bind file that is to be generated by the precompiler. The
file name must have an extension of .bnd. If a file name is
not entered, the precompiler uses the name of the program (entered as the
filename parameter), and adds the .bnd extension.
If a path is not provided, the bind file is created in the current directory.
- BLOCKING
- For information about row blocking, see the Administration Guide or the Embedded SQL Programming Guide.
- ALL
- Specifies to block for:
- Read-only cursors
- Cursors not specified as FOR UPDATE OF
Ambiguous cursors are treated as read-only.
- NO
- Specifies not to block any cursors. Ambiguous cursors are treated as
updateable.
- UNAMBIG
- Specifies to block for:
- Read-only cursors
- Cursors not specified as FOR UPDATE OF
Ambiguous cursors are treated as updateable.
- CCSIDG double-ccsid
- An integer specifying the coded character set identifier (CCSID) to be
used for double byte characters in character column definitions (without a
specific CCSID clause) in CREATE and ALTER TABLE SQL statements. This DRDA
precompile/bind option is not supported by DB2. The DRDA server will use a
system defined default value if this option is not specified.
- CCSIDM mixed-ccsid
- An integer specifying the coded character set identifier (CCSID) to be
used for mixed byte characters in character column definitions (without a
specific CCSID clause) in CREATE and ALTER TABLE SQL statements. This DRDA
precompile/bind option is not supported by DB2. The DRDA server will use a
system defined default value if this option is not specified.
- CCSIDS sbcs-ccsid
- An integer specifying the coded character set identifier (CCSID) to be
used for single byte characters in character column definitions (without a
specific CCSID clause) in CREATE and ALTER TABLE SQL statements. This DRDA
precompile/bind option is not supported by DB2. The DRDA server will use a
system defined default value if this option is not specified.
- CHARSUB
- Designates the default character sub-type that is to be used for column
definitions in CREATE and ALTER TABLE SQL statements. This DRDA
precompile/bind option is not supported by DB2.
- BIT
- Use the FOR BIT DATA SQL character sub-type in all new character columns
for which an explicit sub-type is not specified.
- DEFAULT
- Use the target system defined default in all new character columns for
which an explicit sub-type is not specified.
- MIXED
- Use the FOR MIXED DATA SQL character sub-type in all new character columns
for which an explicit sub-type is not specified.
- SBCS
- Use the FOR SBCS DATA SQL character sub-type in all new character columns
for which an explicit sub-type is not specified.
- COLLECTION schema-name
- Specifies an 8-character collection identifier for the package. If not
specified, the authorization identifier for the user processing the package is
used.
- CONNECT
-
- 1
- Specifies that a CONNECT statement is to be processed as a type 1 CONNECT.
- 2
- Specifies that a CONNECT statement is to be processed as a type 2 CONNECT.
- DATETIME
- Specifies the date and time format to be used. For more information about
date and time formats, see the SQL Reference.
- DEF
- Use a date and time format associated with the country code of the
database.
- EUR
- Use the IBM standard for Europe date and time format.
- ISO
- Use the date and time format of the International Standards Organization.
- JIS
- Use the date and time format of the Japanese Industrial Standard.
- LOC
- Use the date and time format in local form associated with the country
code of the database.
- USA
- Use the IBM standard for U.S. date and time format.
- DEC
- Specifies the maximum precision to be used in decimal arithmetic
operations. This DRDA precompile/bind option is not supported by DB2. The DRDA
server will use a system defined default value if this option is not
specified.
- 15
- 15-digit precision is used in decimal arithmetic operations.
- 31
- 31-digit precision is used in decimal arithmetic operations.
- DECDEL
- Designates whether a period (.) or a comma (,) will be used
as the decimal point indicator in decimal and floating point literals. This
DRDA precompile/bind option is not supported by DB2. The DRDA server will use
a system defined default value if this option is not specified.
- COMMA
- Use a comma (,) as the decimal point indicator.
- PERIOD
- Use a period (.) as the decimal point indicator.
- DEFERRED_PREPARE
- Provides a performance enhancement when accessing DB2 common server
databases or DRDA databases. This option combines the SQL PREPARE statement
flow with the associated OPEN, DESCRIBE, or EXECUTE statement flow to minimize
inter-process or network flow.
- NO
- The PREPARE statement will be executed at the time it is issued.
- YES
- Execution of the PREPARE statement will be deferred until the
corresponding OPEN, DESCRIBE, or EXECUTE statement is issued.
The PREPARE statement will not be deferred if it uses the INTO clause,
which requires an SQLDA to be returned immediately. However, if the PREPARE
INTO statement is issued for a cursor that does not use any parameter markers,
the processing will be optimized by pre-OPENing the cursor when the PREPARE is
executed.
- ALL
- Same as YES, except that a PREPARE INTO statement which contains parameter
markers is deferred. If a PREPARE INTO statement does not contain
parameter markers, pre-OPENing of the cursor will still be performed.
If the PREPARE statement uses the INTO clause to return an SQLDA, the
application must not reference the content of this SQLDA until the OPEN,
DESCRIBE, or EXECUTE statement is issued and returned.
- DEGREE
- Specifies the degree of parallelism for the execution of static SQL
statements in an SMP system. This option does not affect CREATE INDEX parallelism.
- 1
- The execution of the statement will not use parallelism.
- degree-of-parallelism
- Specifies the degree of parallelism with which the statement can be
executed, a value between 2 and 32 767 (inclusive).
- ANY
- Specifies that the execution of the statement can involve parallelism
using a degree determined by the database manager.
- DISCONNECT
-
- AUTOMATIC
- Specifies that all database connections are to be disconnected at commit.
- CONDITIONAL
- Specifies that the database connections that have been marked RELEASE or
have no open WITH HOLD cursors are to be disconnected at commit.
- EXPLICIT
- Specifies that only database connections that have been explicitly marked
for release by the RELEASE statement are to be disconnected at commit.
- DYNAMICRULES
- Specifies which authorization identifier to use when dynamic SQL in a
package is executed. This DRDA precompile/bind option is not supported by DB2.
- BIND
- Indicates that the authorization identifier used for the execution of
dynamic SQL is the package owner.
- RUN
- Indicates that the authorization identifier used for the execution of
dynamic SQL is the authid of the person executing the package.
- EXPLAIN
- Stores information in the Explain tables about the access plans chosen for
each SQL statement in the package. DRDA does not support the ALL value for
this option.
- NO
- Explain information will not be captured.
- YES
- Explain tables will be populated with information about the chosen access
plan.
- ALL
- Explain information for each eligible static SQL statement will be placed
in the Explain tables. In addition, Explain information will be gathered for
eligible dynamic SQL statements at run time, even if the CURRENT EXPLAIN
SNAPSHOT register is set to NO. For more information about special
registers, see the SQL Reference.
Note: | This value for EXPLAIN is not supported by DRDA.
|
- EXPLSNAP
- Stores Explain Snapshot information in the Explain tables. This DB2
precompile/bind option is not supported by DRDA.
- NO
- An Explain Snapshot will not be captured.
- YES
- An Explain Snapshot for each eligible static SQL statement will be placed
in the Explain tables.
- ALL
- An Explain Snapshot for each eligible static SQL statement will be placed
in the Explain tables. In addition, Explain Snapshot information will be
gathered for eligible dynamic SQL statements at run time, even if the CURRENT
EXPLAIN SNAPSHOT register is set to NO. For more information about
special registers, see the SQL Reference.
- FUNCPATH
- Specifies the function path to be used in resolving user-defined distinct
types and functions in static SQL. If this option is not specified, the
default function path is "SYSIBM","SYSFUN",USER where USER is the value of the
USER special register. This DB2 precompile/bind option is not supported by
DRDA.
- schema-name
- A short SQL identifier, either ordinary or delimited, which identifies a
schema that exists at the application server. No validation that the schema
exists is made at precompile or at bind time. The same schema cannot appear
more than once in the function path. The number of schemas that can be
specified is limited by the length of the resulting function path, which
cannot exceed 254 bytes. The schema SYSIBM does not need to be explicitly
specified; it is implicitly assumed to be the first schema if it is not
included in the function path. For more information, see the SQL Reference.
- INSERT
- Allows a program being precompiled or bound from a DB2 V2.1 client
to a DATABASE 2 Parallel Edition server to request that data inserts be
buffered to increase performance.
- BUF
- Specifies that inserts from an application should be buffered.
- DEF
- Specifies that inserts from an application should not be buffered.
- ISOLATION
- Determines how far a program bound to this package can be isolated from
the effect of other executing programs. For more information about isolation
levels, see the SQL Reference.
- CS
- Specifies Cursor Stability as the isolation level.
- NC
- No Commit. Specifies that commitment control is not to be used. This
isolation level is not supported by DB2.
- RR
- Specifies Repeatable Read as the isolation level.
- RS
- Specifies Read Stability as the isolation level. Read Stability ensures
that the execution of SQL statements in the package is isolated from other
application processes for rows read and changed by the application.
- UR
- Specifies Uncommitted Read as the isolation level.
- LANGLEVEL
- Specifies the SQL rules that apply for both the syntax and the semantics
for both static and dynamic SQL in the application. This option is not
supported by DDCS. For more information about this option, see the Embedded SQL Programming Guide.
- MIA
- Select the ISO/ANS SQL92 rules as follows:
- to support checking of SQLCODE or SQLSTATE values, variables by this name
may be declared in the host variable declare section (if neither is declared,
SQLCODE is assumed during precompilation)
- C null-terminated strings are padded with blanks and always include a
null-terminating character, even if truncation occurs
- the FOR UPDATE clause is optional for all columns to be updated in a
positioned UPDATE
- a searched UPDATE or DELETE requires SELECT privilege on the object table
of the UPDATE or DELETE statement if a column of the object table is
referenced in the search condition or on the right hand side of the assignment
clause
- a column function that can be resolved using an index (for example MIN or
MAX) will also check for nulls and return warning SQLSTATE 01003 if there were
any nulls
- an error is returned when a duplicate unique constraint is included in a
CREATE or ALTER TABLE statement
- an error is returned when no privilege is granted and the grantor has no
privileges on the object (otherwise a warning is returned).
- SAA1
- Select the common IBM DB2 rules as follows:
- to support error SQLCODE or SQLSTATE checking, an SQLCA must be declared
in the application code
- C null-terminated strings are not terminated with a null character if
truncation occurs
- the FOR UPDATE clause is required for all columns to be updated in a
positioned UPDATE
- a searched UPDATE or DELETE will not require SELECT privilege on the
object table of the UPDATE or DELETE statement unless a fullselect in the
statement references the object table
- a column function that can be resolved using an index (for example MIN or
MAX) will not check for nulls and warning SQLSTATE 01003 is not returned
- a warning is returned and the duplicate unique constraint is ignored
- an error is returned when no privilege is granted.
- SQL92E
- Defines the ISO/ANS SQL92 rules as follows:
- to support checking of SQLCODE or SQLSTATE values, variables by this name
may be declared in the host variable declare section (if neither is declared,
SQLCODE is assumed during precompilation)
- the behaviours listed under option MIA.
- LEVEL consistency-token
- Defines the level of a module using the consistency token. The consistency
token is any alphanumeric value up to 8 characters in length. The RDB package
consistency token verifies that the requester's application and the
relational database package are synchronized. This DRDA precompile option is
not supported by DB2.
Note: | This option is not recommended for general use.
|
- MESSAGES message-file
- Specifies the destination for warning, error, and completion status
messages. A message file is created whether the bind is successful or not. If
a message file name is not specified, the messages are written to standard
output. If the complete path to the file is not specified, the current
directory is used. If the name of an existing file is specified, the contents
of the file are overwritten.
- NOLINEMACRO
- Suppresses the generation of the #line macros in the output
.c file. Useful when the file is used with development tools
which require source line information such as profiles, cross-reference
utilities, and debuggers.
Note: | This precompile option is used for the C/C++ programming
languages only.
|
- OPTLEVEL
- Indicates whether the C/C++ precompiler is to optimize
initialization of internal SQLDAs when host variables are used in SQL
statements. Such optimization can increase performance when a single SQL
statement (such as FETCH) is used inside a tight loop.
- 0
- Instructs the precompiler not to optimize SQLDA initialization.
- 1
- Instructs the precompiler to optimize SQLDA initialization. This value
should not be specified if the application uses:
For more information, see the Embedded SQL Programming
Guide.
- OUTPUT filename
- Overrides the default name of the modified source file produced by the
compiler. It can include a path.
- OWNER authorization-id
- Designates an 8-character authorization identifier for the package owner.
The owner must have the privileges required to execute the SQL statements in
the package. The default is the primary authorization ID of the
precompile/bind process if this option has not been explicitly specified. This
DRDA precompile/bind option is not supported by DB2.
- PACKAGE
- Creates a package. If neither package, bindfile, nor
syntax is specified, a package is created in the database by
default.
- USING package-name
- The name of the package that is to be generated by the precompiler. If a
name is not entered, the name of the application program source file (minus
extension and folded to uppercase) is used. Maximum length is 8 characters.
- QUALIFIER qualifier-name
- Provides an 18-character implicit qualifier for unqualified table names,
views, indexes, and aliases contained in the package. The default is the
owner's authorization ID, whether or not owner is explicitly
specified. This DRDA precompile/bind option is not supported by DB2.
- QUERYOPT optimization-level
- Indicates the desired level of optimization for all static SQL statements
contained in the package. The default value is 5. For the complete range of
optimization levels available, see the SET CURRENT QUERY OPTIMIZATION
statement in the SQL Reference. This DB2 precompile/bind option is not supported by DRDA.
- RELEASE
- Indicates whether resources are released at each COMMIT point, or when the
application terminates. This DRDA precompile/bind option is not supported by
DB2.
- COMMIT
- Release resources at each COMMIT point. Used for dynamic SQL statements.
- DEALLOCATE
- Release resources only when the application terminates.
- SQLCA
- For FORTRAN applications only. This option is ignored if it is used with
other languages.
- NONE
- Specifies that the modified source code is not consistent with the SAA
definition.
- SAA
- Specifies that the modified source code is consistent with the SAA
definition.
- SQLERROR
- Indicates whether to create a package or a bind file if an error is
encountered.
- CHECK
- Specifies that the target system performs all syntax and semantic checks
on the SQL statements being bound. A package will not be created as part of
this process. If, while creating a package, an existing package with the same
name and version is encountered, the existing package is neither dropped nor
replaced if action replace was specified.
- CONTINUE
- A package or a bind file is created even when SQL errors are encountered.
This option is not supported by DB2.
- NOPACKAGE
- A package or a bind file is not created if an error is encountered.
- SQLFLAG
- Identifies and reports on deviations from the SQL language syntax
specified in this option.
A bind file or a package is created only if the bindfile or the
package option is specified, in addition to the sqlflag
option.
Local syntax checking is performed only if one of the following options is
specified:
- bindfile
- package
- sqlerror check
- syntax
If sqlflag is not specified, the flagger function is not
invoked, and the bind file or the package is not affected.
- SQL92E SYNTAX
- The SQL statements will be checked against ANSI or ISO SQL92 Entry level
SQL language format and syntax with the exception of syntax rules that would
require access to the database catalog. Any deviation is reported in the
precompiler listing.
- MVSDB2V23 SYNTAX
- The SQL statements will be checked against MVS DB2 Version 2.3 SQL
language syntax. Any deviation from the syntax is reported in the precompiler
listing.
- MVSDB2V31 SYNTAX
- The SQL statements will be checked against MVS DB2 Version 3.1 SQL
language syntax. Any deviation from the syntax is reported in the precompiler
listing.
- MVSDB2V41 SYNTAX
- The SQL statements will be checked against MVS DB2 Version 4.1 SQL
language syntax. Any deviation from the syntax is reported in the precompiler
listing.
- SQLRULES
- Specifies whether type 2 CONNECTs are to be processed according to the DB2
rules or the Standard (STD) rules based on ISO/ANS SQL92.
- DB2
- Allow the use of the SQL CONNECT statement to switch the current
connection to another established (dormant) connection.
- STD
- Allow the use of the SQL CONNECT statement to establish a new connection
only. The SQL SET CONNECTION statement must be used to switch to a dormant
connection.
- SQLWARN
- Indicates whether warnings will be returned from the compilation of
dynamic SQL statements (via PREPARE or EXECUTE IMMEDIATE), or from describe
processing (via PREPARE...INTO or DESCRIBE). This DB2 precompile/bind option
is not supported by DRDA.
- NO
- Warnings will not be returned from the SQL compiler.
- YES
- Warnings will be returned from the SQL compiler.
Note: | SQLCODE +238 is an exception. It is returned regardless of the
sqlwarn option value.
|
- STRDEL
- Designates whether an apostrophe (') or double quotation marks
(") will be used as the string delimiter within SQL statements. This DRDA
precompile/bind option is not supported by DB2. The DRDA server will use a
system defined default value if this option is not specified.
- APOSTROPHE
- Use an apostrophe (') as the string delimiter.
- QUOTE
- Use double quotation marks (") as the string delimiter.
- SYNCPOINT
- Specifies how commits or rollbacks are to be coordinated among multiple
database connections.
- NONE
- Specifies that no Transaction Manager (TM) is to be used to perform a
two-phase commit, and does not enforce single updater, multiple reader. A
COMMIT is sent to each participating database. The application is responsible
for recovery if any of the commits fail.
- ONEPHASE
- Specifies that no TM is to be used to perform a two-phase commit. A
one-phase commit is to be used to commit the work done by each database in
multiple database transactions.
- TWOPHASE
- Specifies that the TM is required to coordinate two-phase commits among
those databases that support this protocol.
- SYNTAX
- Suppresses the creation of a package or a bind file during precompilation.
This option can be used to check the validity of the source file without
modifying or altering existing packages or bind files. Syntax is a
synonym for sqlerror check.
If syntax is used together with the package option,
package is ignored.
- TARGET
- Instructs the precompiler to produce modified code tailored to one of the
supported compilers on the current platform.
- IBMCOB
- On AIX, code is generated for the IBM COBOL Set for AIX compiler. On
OS/2, code is generated for the IBM VisualAge for COBOL compiler.
- MFCOB
- Code is generated for the Micro Focus COBOL compiler. On OS/2 this
refers to the 32-bit Micro Focus COBOL compiler. This is the default if a
target value is not specified with the COBOL precompiler on all
UNIX platforms and Windows NT.
- MFCOB16
- Code is generated for the 16-bit Micro Focus COBOL compiler. This value is
only valid on OS/2, and is the default if a target value is
not specified with the COBOL precompiler.
- ANSI_COBOL
- Code compatible with the ANS X3.23-1985 standard is generated.
- C
- Code compatible with the C compilers supported by DB2 on the current
platform is generated.
- CPLUSPLUS
- Code compatible with the C++ compilers supported by DB2 on the
current platform is generated.
- BORLAND_C
- C code is generated for the Borland C/C++ compiler. This value
is only valid on OS/2.
- BORLAND_CPLUSPLUS
- C++ code is generated for the Borland C/C++ compiler.
This value is only valid on OS/2.
- FORTRAN
- Code compatible with the Fortran compilers supported by DB2 on the current
platform is generated.
- TEXT label
- The description of a package. Maximum length is 255 characters. The
default value is blanks. This DRDA precompile/bind option is not supported by
DB2.
- VALIDATE
- Determines when the database manager checks for authorization errors and
object not found errors. The package owner authorization ID is used for
validity checking. This DRDA precompile/bind option is not supported by DB2.
- BIND
- Validation is performed at precompile/bind time. If all objects do not
exist, or all authority is not held, error messages are produced. If
sqlerror continue is specified, a package/bind file is produced
despite the error message, but the statements in error are not executable.
- RUN
- Validation is attempted at bind time. If all objects exist, and all
authority is held, no further checking is performed at execution time.
If all objects do not exist, or all authority is not held at
precompile/bind time, warning messages are produced, and the package is
successfully bound, regardless of the sqlerror continue option
setting. However, authority checking and existence checking for SQL statements
that failed these checks during the precompile/bind process may be redone at
execution time.
- VERSION version-id
- Defines the version identifier for a package. The version identifier is
any alphanumeric value, $, #, @, _, -, or
., up to 254 characters in length. This DRDA precompile option is not
supported by DB2.
- WCHARTYPE
- For details and restrictions on the use and applicability of
wchartype, see the Embedded SQL Programming
Guide.
- CONVERT
- Host variables declared using the wchar_t base type will be treated as
containing data in wchar_t format. Since this format is not directly
compatible with the format of graphic data stored in the database (DBCS
format), input data in wchar_t host variables is implicitly converted to
DBCS format on behalf of the application, using the ANSI C function
wcstombs(). Similarly, output DBCS data is implicitly converted to
wchar_t format, using mbstowcs(), before being stored in host
variables.
- NOCONVERT
- Host variables declared using the wchar_t base type will be treated as
containing data in DBCS format. This is the format used within the database
for graphic data; it is, however, different from the native wchar_t format
implemented in the C language. Using noconvert means that graphic
data will not undergo conversion between the application and the database,
which can improve efficiency. The application is, however, responsible for
ensuring that data in wchar_t format is not passed to the database manager.
When this option is used, wchar_t host variables should not be manipulated
with the C wide character string functions, and should not be initialized with
wide character literals (L-literals).
Usage Notes
A modified source file is produced, which contains host language
equivalents to the SQL statements. By default, a package is created in the
database to which a connection has been established. The name of the package
is the same as the file name (minus the extension and folded to uppercase), up
to a maximum of 8 characters.
Following connection to a database, PREP executes under the transaction
that was started. PREP then issues a COMMIT or a ROLLBACK operation to
terminate the current transaction and start another one.
Creating a package with a schema name that does not already exist will
result in the implicit creation of that schema. The schema owner is SYSIBM.
The CREATEIN privilege on the schema is granted to PUBLIC.
During precompilation, an Explain Snapshot is not taken unless a package is
created and explsnap has been specified. The snapshot is put into
the Explain tables of the user creating the package. Similarily, Explain table
information is only captured when explain is specified, and a
package is created.
Precompiling stops if a fatal error or more than 100 errors occur. If a
fatal error does occur, PREP stops precompiling, attempts to close all files,
and discards the package.
See Also
BIND.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]