informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

rtypmsize()

The rtypmsize() function returns the number of bytes you must allocate in memory for the specified ESQL/C or SQL data type.

Syntax

Usage

The rtypalign() and rtypmsize() functions are useful when you use an sqlda structure to dynamically fetch data into a buffer. These functions provide machine independence for the column-data storage.

Informix provides the rtypmsize() function to use with the sqlda structure that a DESCRIBE statement initializes. After a DESCRIBE statement determines column information, the value of sqltype and sqllen components reside in the components of the same name in each sqlda.sqlvar structure.

When rtypmsize() determines sizes for character data, keep the following size information in mind:

You can see an application of the rtypmsize() function in the unload.ec demonstration program.

Return Codes

0 The sqltype is not a valid SQL type.
>0 The return value is the number of bytes that the sqltype data type requires.

Example

This sample program is in the rtypmsize.ec file in the demo directory.

For a complete listing of the exp_chk() function, see Guide to the exp_chk.ec File or refer to the exp_chk.ec file for a listing of this exception-handling function.

Output


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved