× 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 would like to be able to create a UDF with SQL that reads from table in different libraries and have it use *LIBL to resolve to those tables.

CREATE OR REPLACE FUNCTION "My_UDF"(
"p_File1Field2" CHAR(10))

RETURNS TABLE (
"Field1" VARCHAR(10)
,"Field2" VARCHAR(10)
,"Field3" VARCHAR(10)
,"Field4" VARCHAR(10)
,"Field5" VARCHAR(10)

LANGUAGE SQL

BEGIN
RETURN
SELECT "File1"."Field1"
, "File1"."Field2"
, "File1"."Field3"
, "File2"."Field1"
, "File2"."Field2"
FROM "File1"
LEFT JOIN "File2"
ON "File1"."Field1" = "File2"."Field1"
WHERE "File1"."Field2" = "p_File1Field2"
;
END;

File 2 is in a different Library than File 1 and is different per user. Is there a way to define this so that it uses *LIBL in the SELECT?
Currently it errors that it can't find the File2 in the File1 Library.

Any help would be greatly appreciated!
-Lee

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.