Browse Prior Art Database

Handling of Mixed Data in TRANSLATE Scalar

IP.com Disclosure Number: IPCOM000121937D
Original Publication Date: 1991-Oct-01
Included in the Prior Art Database: 2005-Apr-04
Document File: 2 page(s) / 49K

Publishing Venue

IBM

Related People

Hoffman, RD: AUTHOR [+2]

Abstract

Disclosed is a method that allows the TRANSLATE scalar function to handle MIXED data in a way which eliminates the expansion problem and minimizes the interpretation problem.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 66% of the total text.

Handling of Mixed Data in TRANSLATE Scalar

      Disclosed is a method that allows the TRANSLATE scalar
function to handle MIXED data in a way which eliminates the expansion
problem and minimizes the interpretation problem.

      The SQL TRANSLATE scalar function is used to perform
translation operations (most commonly uppercase mapping) on character
data. If either the target data or the other arguments to the
function contains both single-byte and double-byte characters, the
following problems may occur:
      1.   EXPANSION.  If single-byte characters are intended to map
to double byte characters, the byte length of the target data may
increase during translation.  If the length was already maximal, this
can lead to errors at run time.  In general, the fact that the length
of the result cannot be accurately predicted is a problem.
      2.   INTERPRETATION.  Since character data cannot be
distinguished from binary data in the SAA implementation of SQL, it
is not possible to know whether what appears to be a double-byte
character was, in fact, intended to be understood as a double-byte
character or as a binary byte.

      Previously, these problems have been solved by restricting
arguments to TRANSLATE so that double-byte characters and single-byte
characters cannot occur in the same call.

      We have implemented a version of TRANSLATE in which both
single- byte and double-byte characters are allowed, but must
correspond.  Thus, the...