Output Data Conversion

The following tables describe the conversion results when fetching data from an SQL column to an SQL descriptor area. Each table describes the data conversion for a column according to its core Progress data type.

All column data converted to character data types (for example, SQLDACHAR and SQLDATE) is null-terminated regardless of whether this truncates the result.

Table B–7 describes data conversion from a CHARACTER column to all supported SQL descriptor data types.

Table B–7: Dynamic Output from a CHARACTER Column
Converted
to . . .
Value
Output
Indicator
Variable
Error
Conditions
SQLDACHAR
As much of the character string value as fits in the available storage space.
If the available storage space is too small, set to the number of bytes required for the complete Column value.
None.
SQLDADATE
A valid SQL date string.
N/A
Invalid SQL date string in Column.
SQLDADEC
SQLDANUM
As much of the valid SQL decimal number string as fits in the available storage space, with all leading and trailing white space removed.
If the available storage space is too small, set to the number of bytes required for the complete Column value.
Invalid decimal string in Column.
Decimal string followed by non-white-space characters.
Decimal string with digit precision > SQLVAR_T->PRECISION.
SQLDADBL
SQLDAFLT
SQLDAREAL
A valid SQL decimal number.
N/A
Invalid decimal string in Column.
Decimal string followed by non-white-space characters.
Decimal string value is too large for target (SQLDADBL or SQLDAFLT) data type.
SQLDAINT
A valid long integer or long integer truncated from a decimal number string in Column.
N/A
Invalid decimal string in Column.
Decimal string followed by non-white-space characters.
String numeric value of Column > 2147483647 or < -2147483648.
SQLDALOG
0 or 1.
N/A
Column does not contain a valid integer or decimal string value equivalent to 0 or 1 (for example, “1.000" or “0001").
Decimal number followed by non-white-space characters.
SQLDASML
A valid short integer or short integer truncated from a decimal number string in Column.
N/A
Invalid decimal string in Column.
Decimal string followed by non-white-space characters.
String numeric value of Column > 32767 or < -32768.

Table B–8 describes data conversion from an INTEGER column to all supported SQL descriptor data types.

Table B–8: Dynamic Output from an INTEGER Column  
Converted
to . . .
Value
Output
Indicator
Variable
Error
Conditions
SQLDACHAR
A valid integer number string.
N/A
Storage space not large enough for integer string value.
SQLDADATE
Not supported.
N/A
Output to SQLDADATE attempted.
SQLDADEC
SQLDANUM
A valid decimal string with a numeric value equivalent to the integer value in Column.
N/A
Storage space not large enough for decimal string value.
SQLDADBL
SQLDAFLT
SQLDAREAL
A floating-point value equivalent to the integer value in Column.
N/A
None.
SQLDAINT
The integer value of Column.
N/A
None.
SQLDALOG
0 or 1.
N/A
Column does not contain a value of 0 or 1.
SQLDASML
The short integer value of Column.
N/A
Value of Column > 32767 or < -32768.

Table B–9 describes data conversion from a DECIMAL column to all supported SQL descriptor data types.

Table B–9: Dynamic Output from a DECIMAL Column
Converted
to . . .
Value
Output
Indicator
Variable
Error
Conditions
SQLDACHAR
A valid decimal number string.
If the available storage space is too small to store all decimal digits of the Column value, set to the number of bytes required to store the complete value of Column.
Storage space not large enough for all significant digits to the left of the decimal point.
SQLDADATE
Not supported.
N/A
Output to SQLDADATE attempted.
SQLDADEC
SQLDANUM
A valid decimal number string.
If the available storage space is too small to store all decimal digits of the Column value, set to the number of bytes required to store the complete value of Column.
Storage space not large enough for all significant digits to the left of the decimal point.
SQLDADBL
SQLDAFLT
SQLDAREAL
A floating-point value equivalent to or approximately equivalent to the decimal value in Column.
N/A
Value is greater than maximum floating-point value (for SQLDAFLT type).
SQLDAINT
The decimal-truncated integer value of Column.
N/A
Decimal value of Column > 2147483647 or < -2147483648.
SQLDALOG
0 or 1.
N/A
Column does not contain a value of 0 or 1.
SQLDASML
The decimal-truncated short integer value of Column.
N/A
Decimal value of Column > 32767 or < -32768.

Table B–10 describes data conversion from a DATE column to all supported SQL descriptor data types.

Table B–10: Dynamic Output from a DATE Column
Converted
to . . .
Value
Output
Indicator
Variable
Error
Conditions
SQLDACHAR
A string representation of the valid SQL date in Column.
If the available storage space is too small to store the entire date, set to the number of bytes required to store the complete date value of Column.
Column contains an invalid SQL date.
SQLDADATE
A string representation of the valid SQL date in Column.
N/A
Column contains an invalid SQL date.
SQLDADEC
SQLDANUM
Not supported.
N/A
Output to SQLDADEC or SQLDANUM attempted.
SQLDADBL
SQLDAFLT
SQLDAREAL
Not supported.
N/A
Output to SQLDADBL, SQLDAFLT, or SQLDAREAL attempted.
SQLDAINT
Not supported.
N/A
Output to SQLDAINT attempted.
SQLDALOG
Not supported.
N/A
Output to SQLDALOG attempted.
SQLDASML
Not supported.
N/A
Output to SQLDASML attempted.

Table B–11 describes data conversion from a LOGICAL column to all supported SQL descriptor data types.

Table B–11: Dynamic Output from a LOGICAL Column
Converted
to . . .
Value
Output
Indicator
Variable
Error
Conditions
SQLDACHAR
0 or 1.
N/A
SQLVAR_T->
LENGTH is set to 0.
SQLDADATE
Not supported.
N/A
Output to SQLDADATE attempted.
SQLDADEC
SQLDANUM
0 or 1.
N/A
None.
SQLDADBL
SQLDAFLT
SQLDAREAL
0 or 1.
N/A
None.
SQLDAINT
0 or 1.
N/A
None.
SQLDALOG
0 or 1.
N/A
None.
SQLDASML
0 or 1.
N/A
None.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095