Question

  Asked: Mar 4 2008   0:25 AM GMT
  Asked by: Dwk001


Having trouble with DB2/400 UDF returning a table.


DB2/400, UDF, Table Functions, SQL, RPGLE

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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


Start this Answer and Earn your Knowledge Points!

By clicking "Create Answer", you can write the answer to this question that can be improved upon by your peers using the Answer Wiki.

Browse more Questions and Answers on AS/400 and Development.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register