Having trouble with DB2/400 UDF returning a table.

5 pts.
Tags:
DB2/400
RPGLE
SQL
Table Functions
UDF
I've written a test RPGLE program (not a service program) to return a table that for testing puposes I'm returning 1 row and 1 hard coded return column that is defined as varchar. I'm building the return value by concatonating the input parameters. Anyhow I tried running it using interactive SQL. I waited about 30seconds and got a "Query cannot be run" error due to timeout. I used a service program to debug my rpgle program and the program seems to be working fine. all of the input parms come in correctly and the output parm is being built correctly. I'm returning '02000' as my SQL return code and turning *INLR = *ON. I watched it run in debug mode and it just loops around and around and never returns a value. I would expect that it would only run once and return a value. Any ideas? I could provide the source code if that would be helpful....

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: 2  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
  • BigKat
    8,220 pointsBadges:
    report
  • TomLiotta
    Ideas? Without even seeing the basics of the structure of the code? Maybe it's running Cycle code. Maybe it's failing to increment/decrement a limit variable. Maybe it has a condition not being set for a DOW-loop. Maybe...? Any chance we could see some useful code? How about the CREATE FUNCTION statement? Can we at least know the OS version/release? How is it being referenced? 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