6.4.2 Supported C Data Types

Table of Contents Previous Next


6 Database Utilities : 6.4 ECPGPlus : 6.4.2 Supported C Data Types

An ECPGPlus application must deal with two sets of data types: SQL data types (such as SMALLINT, DOUBLE PRECISION and CHARACTER VARYING) and C data types (like short, double and varchar[n]). When an application fetches data from the server, ECPGPlus will map each SQL data type to the type of the C variable into which the data is returned.
ECPGPlus can convert any SQL type into C character values (char[n] or varchar[n]). Although it is safe to convert any SQL type to/from char[n] or varchar[n], it is often convenient to use more natural C types such as int, double, or float.
In addition to the numeric and character types supported by C, the pgtypeslib run-time library offers custom data types (and functions to operate on those types) for dealing with date/time and exact numeric values:
To use a data type supplied by pgtypeslib, you must #include the proper header file.

6 Database Utilities : 6.4 ECPGPlus : 6.4.2 Supported C Data Types

Table of Contents Previous Next