SQL/MX 2.x Reference Manual (H06.04+)

Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
3-80
Considerations for SET DESCRIPTOR
Considerations for SET DESCRIPTOR
When you set the TYPE item, all other items are reset to the default. If you set TYPE,
you must specify information for any other items you need.
Null values and SET DESCRIPTOR
If you use SET DESCRIPTOR to set a column's value to be a null value, you must
initialize the host variable to a number with INDICATE_DATA = -1. Otherwise,
NonStop SQL/MX issues an error. For example:
unsigned DECIMAL(3,3) data_pic_2;
strncpy(data_pic_2, " ", sizeof(data_pic_2));
strcpy(data_pic_2, " 000");
SCALE Exact numeric, scale 0. Scale for exact numeric types. SCALE
specifies the number of digits to the right of the decimal point.
TYPE Exact numeric, scale 0.
ANSI codes for data type: 1 character; 2 numeric; 3 decimal; 4
integer; 5 smallint; 6 IEEE float; 7 IEEE real; 8 double
precision; 9 date, time, or timestamp; 10 interval; 12 character
varying.
SQL/MX extensions: -101 character uppercase; -201 numeric
unsigned; -301 decimal unsigned; -302 decimal large; -303
decimal large unsigned; -401 integer unsigned; -402 largeint; -
411 Tandem float, -412 Tandem real, -413 Tandem double,
-502 smallint unsigned; -601 character varying with length
specified in first two bytes.
See Version Differences for TYPE and TYPE_FS
on
page 3-83.
TYPE_FS* Exact numeric, scale 0. These codes are the SQL/MP-specific
codes returned in the SQL descriptor area, as shown under
SQL Descriptor Area Data Type Declarations of GET
DESCRIPTOR on page 3-50.
This field does not provide the ANSI codes for data type. The
ANSI codes are provided by TYPE.
See Version Differences for TYPE and TYPE_FS on
page 3-83.
VARIABLE_DATA Actual data associated with the dynamic parameter. The type,
length, name, and so on, are determined by other fields.
This field is equivalent to the ANSI-named DATA field. You can
also use DATA as the name of the field.**
This field cannot contain arithmetic computation.
VARIABLE_POINTER* Pointer to the value of VARIABLE_DATA.
* The statement item is an SQL/MX extension.
** The SQL/MX name is different from the ANSI name.
Table 3-5. SET DESCRIPTOR Descriptor Area Items (page 2 of 2)
Field Data Type and Description