Hi Gio,

is "getprice" really an UDTF - an User Defined Table Function? Or is it an UDF - an User Defined Function?

From your description of the function I would say, its a UDF - it receives one parameter (item code) and returns one result (price).

You can use it like this:

select getprice(item.code), item.*
from item
order by 1

or

order by getprice(item.code)

Both will work.

HTH
Daniel


Am 14.02.2026 um 22:26 schrieb gio.cot via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:

Hi all

Suppose i have a file master item with two fields : code and descr

i have an UDTF "getprice", that have as input code (master code) and that
return price.

as i would need to have a result sorted for price, i was asking me if it
possible to run this SQL statement

select * from item as i left join table(getprice(:i.code)) as p on i.code =
p.code order by p.price

Thanks in advance
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.