stored procedure

5 pts.
Tags:
Web development
When I write an external RPGLE stored procedure that returns a result set does not return anything although it seems to return something when I debug it. Something seems to be missing because when I return an array it works fine. What am I doing wrong? Below is a piece of my code EVAL SQ='SELECT K7HETO, K7HMHN, K7HTIM, K7HFLT, K7HEFO, K7HEAF, K7HEPH, K7HEAN,'''',1 FROM NITDBFEU/TSF70H WHERE K7HANT=' EXEC SQL PREPARE S0 FROM : SQ END-EXEC EXEC SQL DECLARE C7P SCROLL CURSOR FOR S0 END-EXEC EXEC SQL OPEN C7P END-EXEC EXEC SQL set result sets cursor C7P END-EXEC EVAL *INLR=*ON RETURN
ASKED: March 26, 2007  3:14 AM
UPDATED: March 27, 2007  1:30 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

There must be some code missing from what you’ve shown, because the WHERE clause is incomplete. Note that it ends in an =. Let’s say that you have a variable of the same type as your key, named MYKEY. Simpler SQL for what you’ve shown would be:

EXEC SQL
SELECT K7HETO,
K7HMHN,
K7HTIM,
K7HFLT,
K7HEFO,
K7HEAF,
K7HEPH,
K7HEAN,
”,
1
FROM NITDBFEU/TSF70H
WHERE K7HANT=MYKEY
END-EXEC

Then, go on from the point at which you do the OPEN.

Discuss This Question: 1  Reply

 
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
  • GTseli
    I have not included the whole Select string because it is long enough but I can ensure you it works just fine as I have checked it with debug. When I call the procedure it returns "CALL statement complete" but no data. The string to create the procedure is CREATE PROCEDURE TSELIKIS/TESS(IN p1 CHAR ( 3), IN p2 CHAR ( 2), I p3 CHAR ( 4), IN p4 CHAR ( 2)) RESULT SETS 1 NOT DETERMINISTIC CONTAINS SQL EXTERNAL NAME NCAROBJEU/SPP001HT PARAMETER STYLE GENERAL
    5 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