DB2 rules are well defined:

https://www.ibm.com/docs/en/i/7.5.0?topic=assignments-character-graphic-string

"When a string is assigned to a fixed-length string column, parameter, or
transition variable and the length of the string is less than the length
attribute of the target, the string is padded on the right with the
necessary number of single-byte, double-byte, or UTF-16 or UCS-2 blanks.1
The pad character is always a blank, even for bit data."

HTH
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno mer 21 mag 2025 alle ore 18:34 cesco via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> ha scritto:

I wonder how SQLite does this under the covers. They mapped different
data types to storage classes. As I understand, things like e. g. varchar
are an internal alias to "text". But then, SQLite doesn't bring with it a

Taking in account other DBMS, for example mysql, if you use unicode UTF8
fields, by default now it allocates 4 bytes "per character" (it allocates
the maximum possible).

Regarding IBMi I think it has - historically - the correct approach, "more
correct" than other platforms, because it has explicit CCSID attached to a
piece of information.
A char buffer in RPG has-a CCSID. A prototype parameter has-a CCSID. A
stream file on IFS has-a CCSID. A field in the db has-a CCSID. You don't
guess like in other platforms and the conversion points are well defined if
respected.
RPG has now support for unicode (i.e. substring in "natural" mode etc.).
To use richer services over unicode, like i.e. "remove all accents in a
string", or translitarations, you call into ICU API (in QICU library on
IBMi ... despite IBM should really take time to refresh it, the last mod
dates I see on the SRVPGM on my system are 2009... cmon IBM.... refresh
those C/C++ compilers....).


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.