I've been attempting to create a Db2 (the database is hosted on an IBM i,
running 7.3) view in which one of the fields (a character/char field) is
constructed by concatenating several different pieces of data together.
The catch is that between each of these fields of data, there needs to be
a tab present which is used for delimiting the fields in a DataMatrix
barcode.
The following is an ASCII and EBCDIC character set that I'm using as a
reference:
https://www.ibm.com/support/knowledgecenter/SSGH4D_16.1.0/com.ibm.xlf161.a
ix.doc/language_ref/asciit.html
I'm using the hexadecimal code for a horizontal tab as follows to try and
concatenate the tabs in the character field that I'm constructing(e.g.):
select 'data1' || X'09' || 'data2' from
sysibm.sysdummy1;
Unfortunately, the only thing present, which results from the hexadecimal
code (X'09') appears to be one single space, as follows:
Result set:
data1 data2
When I use the resulting field in the view to generate a 2D barcode, there
are actually no spaces at all delimiting the fields (seen after scanning
said barcode). What's the trick to actually getting a tab to be rendered
in a Db2 view field? Is there a different code or function I should be
using? I've also tried using char(05) and char(09), but to no avail. In
addition, I've tried casting the hexadecimal code as a character, as
follows, but with no success:
select 'data1' || cast(X'09' as CHAR) || 'data2' from
sysibm.sysdummy1;
Any thoughts or ideas would be much appreciated!
Thanks,
Kyle
As an Amazon Associate we earn from qualifying purchases.