can you do this ?

select 'data1' || '-' || 'data2' from

sysibm.sysdummy1






Don Brown
Director

MSD Information Technology
t: 07 3368 7888
m: 0408 751 644
e: dbrown@xxxxxxxxxx
www.msd.net.au



From: "Kyle Rainville" <krainville@xxxxxxxxxxxxxxxxx>
To: <midrange-l@xxxxxxxxxxxxxxxxxx>
Date: 05/02/2020 11:20 AM
Subject: How to concatenate a tab in a Db2 view field?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>



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.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.