The comparison on ' ' into "case when" conditions on union sighting with constants in the array list
SQL-Example:
create table test_rf (MEKZ NCHAR(2), id int);
-- Datarecord with 1 space
insert into test_rf values (N' ', 1);
-- Create View
create or replace view test_rf1 as
select N' ' as MEKZ , id, 'cons' as typ from test_rf
union all
select MEKZ, id, 'data' as typ from test_rf
select id, case when MEKZ = N' ' then 'EMTPY' else 'NOTEMPTY' end as MEKZ_STATE, typ from test_rf1
Result:
ID MEKZ_STATE TYP
1 EMTPY cons
1 NOEMPTY data
Expects war is have here all data records in the field the MEKZ condition cave EMPTY value
create table test_rf (MEKZ NCHAR(2), id int);
-- Datarecord with 1 space
insert into test_rf values (N' ', 1);
-- Create View
create or replace view test_rf1 as
select N' ' as MEKZ , id, 'cons' as typ from test_rf
union all
select MEKZ, id, 'data' as typ from test_rf
select id, case when MEKZ = N' ' then 'EMTPY' else 'NOTEMPTY' end as MEKZ_STATE, typ from test_rf1
Result:
ID MEKZ_STATE TYP
1 EMTPY cons
1 NOEMPTY data
Expects war is have here all data records in the field the MEKZ condition cave EMPTY value
0