Kbase 17838: SQL UNIONS and Differing Column Sizes ... What Happens
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
SQL UNIONS and Differing Column Sizes ... What Happens
If you do a SQL UNION and the data format does not match (i.e. the
first SELECT is CHAR(10) and the second SELECT is CHAR(30)) Progress
gives the combined result field a size of CHAR(10) and not CHAR(30)
like some people expect.
The fact that we pick the smaller of the two sizes can be considered a
bug (although it isn't). An enhancement request has been submitted
asking for this behavior to change.
However, according to the 1992 ANSI SQL standard, section 7.10 <query
expression>, leveling rule 2e:
2) The following restrictions apply for Entry SQL in addition to
any Intermediate SQL restrictions:
E) If UNION is specified, then except for column names, the
descriptors of the first and second operands shall be
identical and the descriptor of the result is identical
to the descriptor of the operands.
In other words, doing a UNION on two fields with differing data types
or data lengths is not truly valid according to the ANSI standard.
Progress Software Technical Support Note # 17838