×
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.
Robert,
It's not quite as straightforward as it seems... When you run CREATE
PROCEDURE to create an external UDF (i.e. one that calls an RPG or other
HLL program) it does not actually create an object on disk. It just
creates a definition inside the database of how to call your RPG
program/srvpgm.
However, you do have the option to specify a library on the CREATE
PROCEDURE statement. CREATE PROCEDURE MYLIB/MYPROC... If
unspecified, it uses *CURLIB, like most all IBM-supplied create
commands. The library you give here is also saved to the definition
inside the database.
When you call a procedure, it can search *LIBL (or your SQL PATH, etc)
but it does this by looking inside the special IBM supplied PF -- which
is a little hard to understand at first, but basically instead of
searching for an object on disk by library list, it searches the SQL
Table looking for a matching procedure. For example if your library
list is LIB1, LIB2, LIB3, then it looks in the PF for a procedure under
LIB1 first, if not found it looks under LIB2, and if still not found, it
looks under LIB3 -- so even though it's searching records in a file, it
searches them as if searching a library list.
And the definition that it finds in that file is subsequently used to
find/call your RPG routine. (This definition could potentially also use
*LIBL, so you end up searching the library list twice -- but that is not
recommended.)
On 8/2/2013 9:11 AM, Robert Mullis wrote:
I am trying to create my first UDF to use in embedded SQL in an RPGLE
program. I have created the procedure in a service program with no
problem, but I have a question about the UDF. When the UDF is created,
what library is it created in? Also, if the service program that the
UDF uses is moved to another library, what happens to the UDF? Does it
move to the new library with it?
Thanks,
Robert J. Mullis
As an Amazon Associate we earn from qualifying purchases.