create function rob."gdi.erplxf.rco" ()
returns table
( cmpny dec (2 ),
cmpnam char (30))
language sql
return
select cmpny, cmpnam
from gdi.erplxf.rco
Function gdi.erplxf.rco was created in ROB.
I tested that with:
select b.cmpny,b.cmpnam
from table("gdi.erplxf.rco"()) b
SELECT statement run complete.
Then I ran this:
select a.cmpny ,a.cmpnam
from gdisys.erplxf.rco a
SELECT statement run complete.
But I can't run this:
select a.cmpny, a.cmpnam, b.cmpnam
from gdisys.erplxf.rco a
join table("gdi.erplxf.rco"()) b
using (cmpny)
It aborts with:
SQL0205
Message . . . . : Column CMPNY not in table RCO in ERPLXF.
Cause . . . . . : A column with the name CMPNY does not exist in table
or
view RCO in schema ERPLXF.
From program . . . . . . . . . : QSQXCUTE
From library . . . . . . . . : QSYS
From module . . . . . . . . : QSQXCUTE
From procedure . . . . . . . : CLEANUP
From statement . . . . . . . : 29362
Wait, it's the usual bugs with "USING". This works:
select a.cmpny, a.cmpnam, b.cmpnam
from gdisys.erplxf.rco a
join table("gdi.erplxf.rco"()) b
on a.cmpny=b.cmpny
SELECT statement run complete.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.