[Problem]
A numeric error is returned when executing a select query via isql.
Error :-
========
1> select * from gjang
CT-LIBRARY error: ct_results(): protocol specific layer: external error: There is a tds protocol error.
An invalid numeric precision was received.
[Reproduction]
1. create a table with a default value of numeric on column.
isql -Udba -Psql -Shpita_iqdemo
1> create table gjang(c1 numeric)
2> go
2. execute a select query via isql.
1> select * from gjang
2> go
[Cause]
An OpenClient (OC) CT-Lib(isql) is mainly for ASE, which has numeric/decimal datatype limited to scale/precision of 38/38.
The error below is returned when two numeric/decimal values exceeded the scale/precision limits of OpenClient(77/77).
[Error]
An invalid numeric precision was received.
Please refer to below Numeric Data Types.
Numeric Data Types
Adaptive Server, SQL Anywhere, and SAP Sybase IQ have different default precision and scale.
[Solution]
1. When creating a table, use NUMERIC and DECIMAL datatypes with precision less than or equal to 77.
Ex) create table gjang(c1 numeric(77));
2. Use an IQ's default client such as dbisql /dbisqlc instead of isql.
3. Set the two precision options below to less than or equal to 77.
- MAX_CLIENT_NUMERIC_SCALE
- MAX_CLIENT_NUMERIC_PRECISION
Ex) 1> set temporary option MAX_CLIENT_NUMERIC_PRECISION=76
2> go
HTH
======
Gi-Sung Jang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 |