Skip to main content

Problem:

It is common to want to put a text field into a UNION in such a way that the table associated with the union is displayed.  User will then know which table row is coming from which table.

Resolution:

Note that the text field ws-literal1 is populated with 'cmsl' if the row comes from the first table in the union and 'cmss' if it comes from the second table in the union.

DB-PROCESS REC CMSETFLD-REC

... DB-PROCESS-ID SBRCSR

... LEFT(('CMSL',4),WS-LITERL1,'Y') AS LITERL1X

... SBR_NO

... RECORD_NO

... WHERE SBR_NO = :SETFEA-SBR-NO-S

... UNION ALL

DB-OBTAIN   REC CMSETFST-REC

... LEFT(('CMSS',4),WS-LITERL1) AS LITERL1X

... SBR_NO

... RECORD_NO

... WHERE SBR_NO = :SETFEA-SBR-NO-S

Old KB# 2884

#EnterpriseDeveloper
#MFDS