× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A UDTF can only be specified within the from clause of a SQL Statement.
So, the only way is to join the UDTF with a table or view in the FROM Clause
and then use the results.
If information from the table (such as column values) has to be passed as
parameter to the UDTF you have to deal with LATERAL

... something like this
Select ODOBTX, p.*
From Table(Users()) u,
Lateral(Select *
From Table(Object_Ownership(User_Profile => Odobnm)) x) p
Where Odobnm not Like 'Q%'
and Odobnm not Like '#%'
and Object_Name like '%SALES%'
;

Mit freundlichen Grüßen / Best regards

Birgitta Hauser
Modernization ? Education ? Consulting on IBM i
Database and Software Architect
IBM Champion since 2020

"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)
"Learning is experience ? everything else is only information!" (Albert
Einstein)

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Justin
Taylor
Sent: Monday, 5 February 2024 17:00
To: MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: UDTF over every row

I have a UDTF that returns a result set.

select E.* from table(MY_UDTF('1', '2')) E;

I need to call that UDTF for every row in a SELECT and return a combined
result set. The following gives "Subselect with more than one result column
not valid.", but I think it helps to show what I'm trying to accomplish.

select ( select E.* from table(MY_UDTF(T.COL1, T.COL2)) E )
from MY_TABLE T


Any suggestions?

TIA
--
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@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.