db2 progrramers use RPG III language (like me), when we write a record we can write all fields of record or just some fileds. i.e.:
Tabld MYTABLE record name MYREK with 3 fields:
- Code: Select all Expand view RUN
A CAHR(10)
B CHAR(10)
C DECIMAL(3, 0)
I can write all fields with:
- Code: Select all Expand view RUN
A = "FIVEWIN"
B= "WINDOWS"
C=10
WRITE MYREK
or some fields:
- Code: Select all Expand view RUN
A = "ADO"
B= "AS400"
WRITE MYREK
in seconds case field C has blanks (manages inside DB)
in AS400 I use SQL istruction:
- Code: Select all Expand view RUN
SELECT * FROM MYTABLE
I get:
- Code: Select all Expand view RUN
n.Rek A B C
00001 FIVEWIN WINDOWS 10
00002 ado AS400 +++++++++
field C in 2nd record return all ++++++++ because field is not managed in WRITE istrution field C
I can use HEX function in AS400 SQL db2 to avoid seconds record, blank value in hexadecimal is '40'
- Code: Select all Expand view RUN
SELECT * FROM MYTABLE
WHERE HEX(C) <> '404040'
I get:
- Code: Select all Expand view RUN
n.Rek A B C
00001 FIVEWIN WINDOWS 10
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)