DB2 VARCHAR unicode data warehouse

We currently use VARCHAR to store text data in DB2, but we are faced with the problem that the specified VARCHAR length does not match the text length, since in DB2 VARCHAR the specified length is UTF-8 data length, which may vary depending on the stored textual data. For example, some texts contain characters from different languages, and because of this, some texts with 500 characters cannot be stored in VARCHAR (500), etc.

Now we plan to switch to VARGRAPHIC. I need to know what are the limitations of using VARGRAPHIC to store Unicode text data in DB2. Are there any problems using VARGRAPHIC?

+4
source share
1 answer

DB2 does not verify that the data is actually a double-byte string, but it assumes that it should be. Usually drivers will do the right conversion for you, but one day you may encounter some error. However, this is unlikely.

If you use federated databases, then Vargraphic support in queries may fail. In general, the number of error messages for vargraphic data types is somewhat large. Support for this is probably not as well tested and verified as for other data types.

Vargraphic will use a Unicode database (i.e. requires UTF-8) to use UCS-2 widescreen, which means that your space requirements for these columns are doubled. Vargraphic is a native DB2 data type. If you ever migrate from DB2, you will have to do an extra conversion.

+1
source

All Articles