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



This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I have an SQL UDF which is giving me a MCH3601 on the return statement.  I
brought this up on the list last week thinking that SQL had a problem with
RPG's indicator variable.  So I changed the indicator variable to a simple
1A and it still abends.

Subprocedure:
      /eject
     P*--------------------------------------
     P* Procedure name: VALIDTPNBR
     P* Purpose:        Validates Trading partner number
     P* Returns:        '1'=Yes the tp number is valid, '0'=No it is not
     P* Parameter:      tpttype => Trading partner type
     P* Parameter:      tpnbr => Trading partner number
     P*--------------------------------------
     P VALIDTPNBR      B                   EXPORT
     D VALIDTPNBR      PI             1a
     D tpttype                             LIKE(tpnbr.tpttype) CONST
     D tpnbr                               LIKE(tpnbr.tpnbr) CONST

     D* Local fields
     D rValidTpNbr     S              1a
     D wTpName         s            100a

      /free
       wTpName=RtvTpData(tpttype:tpnbr:'TPTPNAME');
       Select;
       When wTpName=*loval or wTpName=*blanks or wTpName='*NONE';
        rValidTpNbr=*off;
       Other;
        rValidTpNbr=*on;
       EndSl;
       return rValidTpNbr;
      /end-free
     P VALIDTPNBR      E

create function WEB/VALIDTPNBR (CHAR (8), CHAR (10))
returns CHAR (1)
simple call
language rpgle
deterministic
reads sql data
returns null on null input
no external action
allow parallel
external name 'WEB/WEBSRV(VALIDTPNBR)'

select FLD1, FLD2,
       VALIDTPNBR(FLD1,FLD2)
from ROB/ALEXEI

Breakpoint at return statement:
RVALIDTPNBR = '1'

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin


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.