Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

7.6 Creating a UAP in 64-bit mode

This section describes how to create at a HiRDB client a UAP that supports 64-bit mode.

Organization of this section
(1) Languages and functions available to 64-bit-mode UAPs
(2) Differences in SQL Communications Area
(3) Differences in the SQL descriptor area
(4) Differences between SQL data types and C data description
(5) Differences in creating UAPs that use hash functions for table partitioning (applicable to HP-UX and Linux editions only)
(6) Migrating a HiRDB client from 32-bit mode to 64-bit mode

(1) Languages and functions available to 64-bit-mode UAPs

(a) Languages

You can use C language, C++ language, and COBOL (COBOL2002) to create UAPs. OOCOBOL is not supported.

(b) Functions

The XA interfaces are not supported. Other functions are fully supported.

The multi-connection facility provides real threads, not pseudo-threads.

(2) Differences in SQL Communications Area

The structure of the SQL Communications Area changes when you set your HiRDB in 64-bit mode. The lengths of the communications area names also change, as shown in the table below. For details about the SQL Communications Area, see Appendix A. SQL Communications Area.

Table 7-4 Communications area names that change in 64-bit mode

Communications area name Length (bytes)
32-bit mode 64-bit mode
SQLCA 336 368
SQLCABC 4 8
SQLCODE 4 8
SQLERRD 4 x 6 8 x 6

(3) Differences in the SQL descriptor area

The structure of SQL descriptor areas changes when you set your HiRDB in 64-bit mode. The lengths of the descriptor area names also change, as shown in the table below. For details about the SQL descriptor areas, see Appendix B. SQL Descriptor Areas.

Table 7-5 Descriptor area names that change in 64-bit mode

Descriptor area name 32-bit mode 64-bit mode
Length (bytes) Data type Length (bytes) Data type
SQLDA 16 + 16 x n -- 24 + 24 x n --
SQLDABC 4 -- 8 --
SQLVAR 16 x n -- 24 x n --
SQLVAR_LOB 16 x n -- 24 x n --
SQLLOBLEN -- long -- int
SQLDATA 4 -- 8 --
SQLIND 4 -- 8 --
SQLLOBIND 4 long * 8 int *

Legend:
n: Number of SQLVARs specified in the descriptor area name SQLN
--: There is no change to the length or data type.

(4) Differences between SQL data types and C data description

In a UAP written in C language when 64-bit mode is supported, the size of the long type is 8 bytes. Therefore, embedded variables that have been using long will use int instead of long. This change affects the data descriptions in C language as shown in the table below. For details about the data descriptions in C language, see Appendix F.1 SQL data types and C data descriptions.

Table 7-6 C data descriptions that change in 64-bit mode

SQL data type C data description Item specification Remarks
INTEGER Simple format int variable-name; variable None
Array format int variable-name[n]; array 1 [Figure] n [Figure] 4096
Indicator variable for BLOB int indicator-variable-name; -- None
SQL statement struct{
int len;
char str[n];
}variable-name;
structure None

Legend:
n: Length (bytes)
--: Cannot be specified

(5) Differences in creating UAPs that use hash functions for table partitioning (applicable to HP-UX and Linux editions only)

When you compile and link a UAP that uses hash functions for table partitioning, the shared libraries to be specified are different. For details about how to create a UAP that uses hash functions for table partitioning, see Appendix H.1 Hash function for table partitioning.

(6) Migrating a HiRDB client from 32-bit mode to 64-bit mode

In order to migrate a HiRDB client from 32-bit mode to 64-bit mode, you must upgrade your HiRDB client to 64-bit mode edition (by installing 64-bit mode edition of HiRDB client and then setting up the client environment). For details about client environment setup, see 6. Client Environment Setup.

When you install the 64-bit mode edition of HiRDB client, files for 64-bit mode are created. For details about the files that are created during installation, see 6.4 Organization of directories and files for a HiRDB client.

Once you have set up the client environment, you must make changes to the UAPs so that they will function in 64-bit mode. The procedure is explained below:

Procedure
  1. If the long type is specified in the declaration of an embedded variable, change it to the int type.
  2. Preprocess the UAP. In this step, specify the option for generating a 64-bit-mode post source (-h64 in UNIX, /h64 in Windows).
  3. Compile the UAP. In this step, specify the option for generating a 64-bit-mode object.
  4. Link the UAP. In this step, specify the 64-bit-mode client libraries to be linked.
Note
For details about preprocessing, compiling, and linking, see 8.2 Preprocessing and 8.3 Compiling and linking.