ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CREATE FUNCTION (External) - Which Subprocedure?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CREATE FUNCTION (External) - Which Subprocedure?

    Something I'm not clear on - In reviewing the syntax for CREATE FUNCTION (External), I know I can specify that the external procedure to be run is a subprocedure in a service program, and where to specify the service program.

    However, I don't see where to specify the name of the actual subprocedure to be run.
    Is the name of the function also the name of the subprocedure to run? Or the specific name of the function?

  • #2
    Here is the creation Statement of one of our external UDFs.
    The Procedure must be specified with the service program, i.e. 'SCHEMA/SRVPGM(PROCEDURE)

    Code:
    CREATE OR REPLACE FUNCTION DIRWEB/DW_DATETONUM (
        PARDATE DATE ,
        PARDATFMT VARCHAR(10) )
        RETURNS DECIMAL(8, 0)   
        LANGUAGE RPGLE
        SPECIFIC DIRWEB/DW_DT2NM02
        DETERMINISTIC
        MODIFIES SQL DATA
        CALLED ON NULL INPUT
        NO EXTERNAL ACTION
        NOT FENCED
        EXTERNAL NAME 'DIRWEB/DWDATTIM(DW_CVTDATETONUM_SQL02)'
        PARAMETER STYLE GENERAL ;
    Birgitta

    Comment

    Working...
    X