Version 1 Sqlda Structure - HP NonStop SQL/MP Programming Manual

For c
Table of Contents

Advertisement

Converting C Programs
Generating a Version 1 SQLDA Structure
If you are converting a program to use the INCLUDE STRUCTURES directive, but you
require a version 1 SQLDA structure, follow these steps:
1. If necessary, remove the RELEASE1 option from the SQL compiler directive or the
INCLUDE SQLDA directive. The C compiler returns an error if you specify the
RELEASE1 option and the INCLUDE STRUCTURES directive.
2. If you specified the RELEASE1 option in an INCLUDE SQLDA directive, remove
any _R1 suffixes you appended to SQLDA field names.
3. Add an INCLUDE STRUCTURES directive with the ALL VERSION 1 option:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 1;
Or specify only the SQLDA VERSION 1 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 1;
Example D-2
shows a version 1 SQLDA structure.
Example D-2. Version 1 SQLDA Structure
#define SQLDA_EYE_CATCHER "DA" /* can have _R1 appended */
struct SQLDA_TYPE
{
char
eye_catcher[2];
short num_entries;
struct SQLVAR_TYPE
{
short data_type;
short data_len;
short null_info;
long
long
} sqlvar[sqlvar_count];
} sqlda-name;
char names-buffer-name[ length + 1 ];
Table D-3
describes the fields in a version 1 SQLDA structure.
Table D-3. Version 1 SQLDA Structure Fields (page 1 of 2)
Field Name
eye_catcher
num_entries
sqlvar
HP NonStop SQL/MP Programming Manual for C—429847-008
var_ptr;
reserved;
Description
Identifying field that a program must initialize as D1 for version 1 or DA
for version 2. SQL/MP statements do not return values to eye_catcher.
Number of input parameters or output variables the SQLDA structure can
accommodate.
Group item that describes input parameters or database columns. The
DESCRIBE INPUT and DESCRIBE statements return one sqlvar entry
for each input parameter or each output variable.
Generating a Version 1 SQLDA Structure
/* can have _R1 appended */
/* can have _R1 appended */
D-6

Advertisement

Table of Contents
loading

Table of Contents