iSeries SQL UDF gets CPF426A

25 pts.
Tags:
iSeries
SQL
UDF Returning DATE
I created a SQL UDF using the iNav wizard.  It created the service program for me yet when I try to use the function I get CPF426A "User-defined function &5 cannot be invoked." with a reason 2 (Either the service program is not found or the program entry point &6 does not exist.)  It says the program entry point is the name of my function with "_1" appended to the end.  Since I didn't create the service program I have no idea how to correct this.  Can anyone help?


Software/Hardware used:
iSeries V5R4 SQL

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Can you show (1) the UDF arguments and return value definitions, and (2) a statement that invokes the UDF? Tom
    125,585 pointsBadges:
    report
  • RJonesPartrick
    The arguments are a decimal 2,0 and a character 2. The return value is character 10. A sample statement is: select item, #MRKT_MGR(comp#,cxcode) as mrktmgr from pubprices join iim on item = iprod join iicx on iclas = cxclas where comp# = 2. The #MRKT_MGR is the UDF. The arguments are values from the file pubprices (comp#) and from iicx (cxcode).
    25 pointsBadges:
    report
  • TomLiotta
    My apologies for coming back so late. I watched for a couple days and didn't see a reply... I should have watched for a couple days plus 13 hours. I'm a little surprised that no one else jumped in. In case you haven't found a resolution -- What are the column definitions of comp# and cxcode? (Particularly, their data types and lengths.) Please show the actual definitions. These should match exactly with the corresponding UDF parm declarations. If the interface parts all match, then schema (library) attributes become of interest. Tom
    125,585 pointsBadges:
    report
  • RJonesPartrick
    Comp# is decimal (2,0) and cxcode is character 2. I finally called IBM on this and their answer is "remove the # symbol from the function name." I did and it worked. Now the thing that bothers me about this is that I have several other functions that start with the # symbol (external RPGLE functions) and they all work perfectly. I'm still waiting for IBM's response to this.
    25 pointsBadges:
    report
  • TomLiotta
    “remove the # symbol from the function name.” Ah, good point. The "#" is not listed as a valid character in the SQL reference. And the only special character listed as valid in a SQL identifier is underscore ("_"). But that's not unusual. Other languages have similar restrictions. At least some COBOL versions, for example, don't allow "#" in names of key fields and possibly others. I missed it probably because I wouldn't have ever tried it just from various bad past experiences. You might consider trying creating SQL VIEWs that have no purpose but to rename fields. I don't envy the potential long-term troubles you'll possibly get stuck with. If this is an old database with existing programs, you'll probably become an expert in "identifier renaming". Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following