Salesforce

Differences between the ABL and SQL in how they display data.

« Go Back

Information

 
TitleDifferences between the ABL and SQL in how they display data.
URL NameDifferences-between-the-ABL-and-SQL-in-how-they-display-data
Article Number000203907
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
Differences between the ABL and SQL in how they display data.
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution

Differences between the ABL and SQL in how they display data.

The ABL DISPLAY statement displays data in a tabular format, and sizes it according to the number of columns it fills on the screen or the printed page. The FORMAT of a field determines the maximum number of columns it can occupy without having DISPLAY return an error.

Oracle and MSSQL databases do not allow data records in which the content of a field is larger than the maximum character length. SQL sizes data according to the number of characters it contains. The WIDTH of a field (MAX-WIDTH in the OpenEdge database schema) determines the maximum number of characters it can return to a SQL query without an error being raised. 

Much of the time the two approaches will render the same result - the characters in the English alphabet and in many other character sets are normally one column wide, so the number of display columns equals the number of characters in a field. However, there are cases where the results will differ.

Full-width characters
The majority of characters in the CJK (Chinese, Japanese and Korean) character sets are normally rendered as full-width characters, each occupying two columns instead of one. This is not always obvious when they are displayed with proportional fonts, but is clear when a fixed-width font is used.

If a field has a FORMAT of "x(10)" and a MAX-WIDTH of 10, and is populated only with full-width characters, the following differences will be observed:

  • ABL DISPLAY will only be able to display 5 characters from the field, because they will fill 10 display columns.
    ||1234567890||
    |一二三四五|

  • A SQL query will be able to display 10 characters (20 columns) from the field.
    |一二三四五六七八九十|

Composite vs. Base plus Combining characters

The character sets for many languages contain characters embellished with diacritics - u-umlaut (ü), for example. Such characters are often stored as single, composite characters (ü), but they can also be stored as a base character (u) with a column value of 1, followed by the diacritic (¨) as a combining character with a column value of 0.

When a character like ü is stored as a composite character, both the ABL and SQL will treat it in the same way, as a single, one-column character.

If ü is stored as a base character plus a combining character, however, the treatment will be different.

  • ABL DISPLAY will combine the characters and assign a column-count of 1.
    ||1234567890||
    |üüüüüüüüüü|

  • SQL, while combining the characters for display, will still count them as 2 characters when checking the width of the data in the field.
    |üüüüü|

Workaround
Notes
Keyword Phrase
Last Modified Date7/8/2021 12:01 PM

Powered by