Kbase P17985: Default calculations for SQL width
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/02/2009 |
|
Status: Verified
GOAL:
What are the default calculations for SQL-92 width
GOAL:
What are the Data Type in SQL-92 width
GOAL:
what is the default size of the NUMERIC data type
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
The current SQL-92 width can be viewed or modified
From Windows:
Data Dictionary -> select table -> Options -> SQL Properties -> Adjust Field Width
From UNIX:
Data Dictionary -> Schema -> SQL Properties -> Adjust Field Width
to a number that your data length is (less than 2K).
The default SQL-92 width algorithm for data types supported by Progress 4GL and their corresponding SQL-92 data types is as follows (unless otherwise specified):
SQL-92
DATA TYPE SQL-92 WIDTH
--------------------------------
VARCHAR x2 CHARACTER
VARBINARY x2 RAW
DECIMAL/NUMERIC 17
DATE = DATE
INTEGER = INTEGER
BIT = LOGICAL
INTEGER = RECID
If the data is larger than the SQL width, error code 210012 or native -210012 and Column in table has value exceeding its max length or precision (7864) will result.
Similarily, the default for SQL-92 VARCHAR is twice 4GL CHARACTER and the SQL-92 width of the field may be longer than that required. This will result in:
MM- Row too big (7711)
from a SELECT() which is due to the limit in the SQL-92 engine.
DECIMAL and NUMERIC are defined in terms of:
+ 'precision': number of digits (max = 50) and
+ 'scale': number of digits to the right of the decimal (max = 10)
Scale cannot be greater than precision.
DATE, INTEGER, LOGICAL and RECID are not applied becuase by their nature, they are equal to that defined.