AnOldNew_Coder
AnOldNew_Coder

Reputation: 33

IBM i UNION *ALL used here

I have this in CL and would like to make it into a view. I first run 2 queries which are creating these 2 tables. How would the code here for the UNION ALL be? the 2 tables are (Logical) views

CPYF       FROMFILE(JETDTA/EODDETAILH) +                 
              TOFILE(JETDTA/EODDETAILS) MBROPT(*ADD) +    
              FMTOPT(*NOCHK)                                
              MONMSG CPF0000              

Upvotes: 0

Views: 121

Answers (1)

elvin
elvin

Reputation: 981

Besides the structure of the queries result must match, you can do it with:

CREATE VIEW yourViewName AS 
SELECT *
FROM JETDTA.EODDETAILH
UNION
SELECT *
FROM JETDTA.EODDETAILS

You can find more information about the CREATE VIEW command here and about the UNION clause here, both of those are part of SQL/400.

Upvotes: 1

Related Questions