Generating A Version 300 (Or Later) Sqlda Structure; Generating A Version 2 Sqlda Structure - HP NonStop SQL/MP Programming Manual

For c
Table of Contents

Advertisement

Converting C Programs

Generating a Version 300 (or Later) SQLDA Structure

To convert a program that generates a version 1 or version 2 SQLDA structure to
generate a version 300 (or later) SQLDA structure, follow these steps:
1. If necessary, remove the RELEASE1 or RELEASE2 option from the SQL compiler
directive or from the INCLUDE SQLDA directive. The C compiler returns an error if
you specify the RELEASE1 or RELEASE2 option and the
INCLUDE STRUCTURES directive.
2. Remove any _R1 or _R2 suffixes appended to SQLDA field names.
3. If you are converting a version 1 SQLDA structure, make sure you initialize the
null_info and ind_ptr fields.
4. Add an INCLUDE STRUCTURES directive and specify the version you want. For
example, this directive generates a version 315 structure:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 315;
Or specify only the SQLDA VERSION 315 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 315;
5. Add the necessary executable statements to process the version 310
SQLDA structure. For the layout of a version 300 (or later) SQLDA structure and a
description of each field, see

Generating a Version 2 SQLDA Structure

If you are converting a program to use the INCLUDE STRUCTURES directive, but you
require a version 2 SQLDA structure, follow these steps:
1. If necessary, remove the RELEASE2 option from the SQL compiler directive or the
INCLUDE SQLDA directive. The C compiler returns an error if you specify the
RELEASE2 option and the INCLUDE STRUCTURES directive.
2. If you specified the RELEASE2 option in an INCLUDE SQLDA directive, remove
any _R2 suffixes you appended to SQLDA field names.
3. If you are converting a version 1 SQLDA structure, initialize the null_info and
ind_ptr fields. (A program should already initialize these fields for a version 2
SQLDA structure.)
4. Add an INCLUDE STRUCTURES directive with the ALL VERSION 2 option:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 2;
Or specify only the SQLDA VERSION 2 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 2;
HP NonStop SQL/MP Programming Manual for C—429847-008
Generating a Version 300 (or Later) SQLDA
Section 10, Dynamic SQL
D-3
Structure
Operations.

Advertisement

Table of Contents
loading

Table of Contents