|
Hi, Michael:
You are correct that the _definition_ of SQL functions and procedures
resides in QSYS2/SYSROUTINE.
Run this SQL query:
select * from QSYS2/SYSROUTINE
and take a look at the contents of the column EXTERNAL_NAME. This
identifies the object (*PGM or *SRVPGM) that _implements_ the function
or procedure.
The actual code that implements such a function or procedure must
necessarily reside in a *PGM or *SRVPGM.
DB2/400 is unique among IBM's DB2 implementations in that you do not
necessarily have to define a *PGM to use it as a "stored procedure" --
any *PGM can be CALLed via the SQL CALL interface. But, if you want to
define it as a FUNCTION, or define the parameter style, etc., then you
need to define it via the SQL CREATE PROCEDURE or CREATE FUNCTION statement.
Hope that helps,
Mark S. Waterbury
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.