× 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.



I ran this:

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

To program . . . . . . . . . . : QSQXCUTE
To library . . . . . . . . . : QSYS
To module . . . . . . . . . : QSQXCUTE
To procedure . . . . . . . . : CLEANUP
To 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 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.