× 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 found in the manual how to CREATE FUNCTION...
>but I'm missing the info on the way the RPG
>will receive the numeric parameter and return
>the char.

h debug dftactgrp(*no) actgrp(*caller)
 * dbgview(*list)

 * Test the length of an SQL string User Defined Function.
 * register:

 * CREATE FUNCTION STRLEN (VARCHAR(256))
 * RETURNS INTEGER
 * RETURNS NULL ON NULL INPUT
 * LANGUAGE RPGLE
 * EXTERNAL NAME 'BUCK/SQLUDFLEN'
 * DETERMINISTIC
 * NO SQL
 * NO EXTERNAL ACTION
 * PARAMETER STYLE SQL
 * DISALLOW PARALLEL

 * to use, select strlen(name),length(name),length(strip(name)),name
 *         from master
 * Yes, I know this is the same as the SQL function LENGTH(STRIP()),
 * I wanted to have a simple example to follow...

d inpChar         s            256    varying
d outLen          s             10i 0
d inpInd          s              5i 0
d outInd          s              5i 0
d outSQLState     s              5
d inpFuncName     s            139    varying
d inpSpecName     s            128    varying
d outDiagTxt      s             70    varying

c     *entry        plist
c                   parm                    inpChar
c                   parm                    outLen
c                   parm                    inpInd
c                   parm                    outInd
c                   parm                    outSQLState
c                   parm                    inpFuncName
c                   parm                    inpSpecName
c                   parm                    outDiagTxt

c     ' '           checkr    inpChar       outLen

c                   eval      *inlr = *on


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.