Specify a DB-Library version level.
RETCODE dbsetversion(version) DBINT version;
The version of DB-Library behavior that the application expects. Table 2-29 lists the symbolic values that are legal for version:
Value of version |
Indicates |
Features supported |
---|---|---|
DBVERSION_46 |
4.6 behavior |
RPCs, registered procedures, remote procedure calls, text and image datatypes. This is the default version of DB-Library. |
DBVERSION_100 |
10.0 behavior |
numeric and decimal datatypes. |
SUCCEED or FAIL.
dbsetversion sets the version of DB-Library behavior that an application expects. DB-Library will provide the behavior requested, regardless of the actual version of DB-Library in use.
An application is not required to call dbsetversion. However, if dbsetversion is not called, DB-Library provides version 4.6-level behavior.
If an application calls dbsetversion, it must do so before calling any other DB-Library routine, with the exception of dbinit.
If you call dbsetversion more than once, an error occurs.
You can set the DB-Library version level at runtime using the SYBOCS_DBVERSION environment variable. When set, this variable changes the application code to use the DB-Library value stored in this variable as the version level.
If this environment variable is not defined, DB-Library provides 4.6-level behavior or uses the version level requested by an explicit dbsetversion call. If the environment variable is defined and dbsetversion is also called, the dbsetversion overrides the environment variable.