SQLDA Data Type Management
Internally, Progress does not differentiate between INTEGER and SMALLINT, between NUMERIC and DECIMAL, or between FLOAT and REAL. When retrieving column attribute information, all columns are described in terms of the following types:
Expressions are typed as CHARACTER, INTEGER (COUNT function), DECIMAL (all other numeric expressions), DATE, or LOGICAL. The Progress RECID function is INTEGER, and CAN-DO is LOGICAL.
Between the DESCRIBE statement (
sqldyndesc()
function) and the FETCH statement (sqldynftch()
function) for cursor specifications, the host program can change the TYPE to indicate the actual target data type for a column. Likewise, between thesqldyndescinp()
function and EXECUTE or OPEN statement (sqldynexec()
function) for all dynamic statements using parameter markers, the host program can change the TYPE to indicate the actual source data type for a parameter marker. ESQL performs the necessary data type conversions. These types are specified in the preceding table and inproesql.h
.For numeric values, ESQL assumes that the target is long for INTEGER columns or parameter markers, and char for DECIMAL columns or parameter markers, unless the program changes the TYPE code before the FETCH, EXECUTE, or OPEN statement. DOUBLE PRECISION values can be fetched into a C double (or supplied from a C double) by setting the TYPE member of the SQLVAR_T structure to a value of SQLDABL.
NOTE: In previous versions of Progress, decimal data returns by default to the application as a floating point number. In effect, this converts an exact numeric value to an approximate numeric value, thereby potentially losing precision. In Version 7 and later, ESQL SQLDANUM and SQLDADEC are returned by default as C character arrays. It is up to the application to convert the values to the data types appropriate to the application, or to fetch into an SQLDADBY, SQLDAREAL, or SQLDAFLT.Progress provides a variety of conversions between Progress/SQL and C data types in dynamic ESQL. For more information, see "ESQL Data Type Compatibilities."
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |