Birgitta,
My question then becomes "Is it possible to make a general UDTF to wrap around qsys2.DISPLAY_JOURNAL_ENTRY_INFO?".
Let's say you are journaling multiple tables.
TableA
ColA01 int
ColA02 char(5)
ColA03 Dec(15,2)
TableB
ColB01 int
ColB02 Dec(7,2)
ColB03 int
ColB04 varchar
...
The end goal being able to take this new table function and be able to use it for both and do stuff like
SELECT journal_code, journal_entry_type, object, object_type, X.*
FROM TABLE (QSYS2.Display_Journal(
JOURNAL_LIBRARY => '#MXJRN',
JOURNAL_NAME => 'BPCS_ALL',
STARTING_TIMESTAMP => TIMESTAMP('2017-01-01-00.00.01'),
STARTING_RECEIVER_NAME => '*CURCHAIN'
) ) AS X
And join that with the new udtf sort of like
Select * from table (qsys2.newudtf(
WHATISTHISTWO => 2,
JOURNAL_LIBRARY => '#MXJRN',
JOURNAL_NAME => 'BPCS_ALL',
SEQUENCE_NUMBER => x.sequence_number,
RECEIVER_LIBRARY => x.receiver_library,
RECEIVER_NAME => x.receiver_name,
JOURNAL_CODE => x.journal_code)) AS Y;
Y.* would contain all of the columns of TableA or TableB depending on which journal entry you were reading.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Birgitta Hauser
Sent: Wednesday, February 13, 2019 1:06 AM
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Reading the results of a stored procedure with a UDTF and/or a view.
Do you mean this article:
Guru: Create A UDTF Wrapper For A Stored Procedure Result Set
https://www.itjungle.com/2019/02/04/guru-create-a-udtf-wrapper-for-a-stored-
procedure-result-set/
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to." (Richard Branson)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Rob Berendt
Sent: Dienstag, 12. Februar 2019 20:01
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Reading the results of a stored procedure with a UDTF and/or a view.
I think I just saw an article on this but I cannot find it.
Basically I want to use a UDTF and/or a view to read the results of
CALL qsys2.DISPLAY_JOURNAL_ENTRY_INFO (
2, '#MXJRN', 'BPCS_ALL', 60988586,
'#MXJRN','ALLRCV7518','R');
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.