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



Rob:

I double checked and there is only one MYFILE out there and I am authorized to 
everything.

I also added 
SET OPTION SQLPATH = *LIBL...
before the BEGIN statement in the function and am getting the same results.   
I'm confused, but am sure there is an answer.

 
>from: rob@xxxxxxxxx
>subject: Re: SQL UDF and *LIBL
>I did this:
>
>CREATE TABLE ROB/ADAM (MYKEY CHAR (1 ) NOT NULL WITH DEFAULT,
>MYDATA CHAR (2 ) NOT NULL WITH DEFAULT) 
>INSERT INTO ROB/ADAM VALUES('A', 'B') 
>CREATE TABLE ROB/ADAM2 (MYKEY CHAR (1 ) NOT NULL WITH DEFAULT,
>MYFIDL CHAR (33 ) NOT NULL WITH DEFAULT) 
>INSERT INTO ROB/ADAM2 VALUES('A', 'DUH')
>CREATE FUNCTION QGPL/GETADAM (INFLD CHAR (1))
>RETURNS CHAR (1) 
>LANGUAGE SQL 
>READS SQL DATA 
>DETERMINISTIC 
>RETURNS NULL ON NULL INPUT 
>BEGIN 
>DECLARE OUTFLD CHAR(1); 
>SET PATH = *LIBL; 
>SELECT MYDATA INTO OUTFLD 
>FROM ADAM 
>WHERE MYKEY=INFLD; 
>RETURN OUTFLD; 
>END -- GETADAM; 

>SELECT MYKEY, GETADAM(MYKEY)
>FROM ROB/ADAM2 
>....+....1....+....2....
>MYKEY  GETADAM ( MYKEY )
>  A            B 
>********  End of data  *
> Rob Berendt
>>Any chance that there may be another copy of MYFILE in your library list?
>>We had someone here who swore that there was not.  They even did a WRKOBJ 
>>and only the one copy showed up.  However, if they did a DSPFD MYFILE then 
>>they got the message "You are not authorized...".  Seems that there was 
>>another copy of the file - they just didn't have authority to it.  That's 
>>why it didn't show up on WRKOBJ.
>>Rob Berendt


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.