Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Error saving strings containing UTF-8 in to exposed columns

SA-8679

Summary



Normal behaviour when saving objects in classes with exposed columns is to truncate the value if the content is longer than the length of the exposed column. 
The complete content is still saved in the BLOB, so user can still see the complete content when retrieved.
However, when the string contains UTF-8 characters, if it is longer than the exposed column, an error is returned.



Error Messages



Get different errors for different databases. This is for Oracle:
Fail: ORA-12899: value too large for column


Steps to Reproduce



1.Create a data class with a Text property. Define a local store for the class, so a table with exposed columns gets created.
2.Create a test activity:
      a. Create a new Page.
      b.Set the property with the exposed column.
      c.Obj-save and Commit.

Following are the two cases:
  • When the property has UTF-8 characters, you get error: Status fail Message Fail: ORA-12899: value too large for column 
  • When the property has no UTF-8 characters, it can be as long as you want, following Warning message opens:
                    Status: warn: Message Property Description has been truncated in its database column;

Root Cause



The root cause of this problem is defect/misconfiguration in the operating environment. 

The database column is defined in bytes but the data being stored is multi-byte characters, so the number of characters that can fit is less than the column length. Hence have advised to use Character length on the column rather than the Bytes. For Eg: In ORACLe use VARCHAR2 (256 CHAR) or NVARCHAR2 (256) compared to VARCHAR2 (256).


Resolution



The explanation for this behavior is as follows:

The error is thrown because DB column is defined to use BYTE storage while data being stored uses multi-byte character set.
It is recommended to use Character type storage.

Published June 12, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us