The precision of a numeric column or parameter refers to the maximum number of digits used by the data type of the column or parameter. The precision of a non-numeric column or parameter generally refers to either the maximum length or the defined length of the column or parameter. The following table defines the precision for each SQL data type.
SQLTYPE |
Precision |
EDS_SQL_CHAR EDS_SQL_VARCHAR |
The defined length of the column or parameter. For example, the precision of a column defined as CHAR(10) is 10. |
EDS_SQL _LONGVARCHAR |
The maximum length of the column or parameter. |
EDS_SQL_DECIMAL |
The defined maximum number of |
EDS_SQL_NUMERIC |
digits. For example, the precision of a column defined as NUMERIC(10,3) is 10. |
EDS_SQL_BIT |
1 |
EDS_SQL_TINYINT |
3 |
EDS_SQL_SMALLINT |
5 |
EDS_SQL_INTEGER |
10 |
EDS_SQL_BIGINT |
20 |
EDS_SQL_REAL |
7 |
EDS_SQL_FLOAT |
15 |
EDS_SQL_DOUBLE |
15 |
EDS_SQL_BINARY |
The defined length of the column or |
EDS_SQL_VARBINARY |
parameter. For example, the precision of a column defined as BINARY(10) is 10. |
EDS_SQL_LONGVARBINARY |
The maximum length of the column or parameter. |
EDS_SQL_DATE |
10 (the number of characters in the yyyy-mm-dd format). |
EDS_SQL_TIME |
8 (the number of characters in the hh:mm:ss format). |
EDS_SQL_TIMESTAMP |
The number of characters in the “yyyy-mm-dd hh:mm:ss[.fff[fff]]” format used by the TIMESTAMP data type. For example, if a timestamp does not use seconds or fractional seconds, the precision is 16 (the number of characters in the “yyyy-mm-dd hh:mm” format). If a timestamp uses thousandths of a second, the precision is 23 (the number of characters in the “yyyy-mm-dd hh:mm:ss.fff” format). |