By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

SQL select not working when starting program is a stored procedure.

P: 2
Hello all,
I have a weird situation here. We are on an ISeries AS400. We have created an SQL table and can access it just fine when the COBOL program is called directly. The problem exists when the process is invoked with a stored procedure. The stored procedure calls a CL and then the COBOL program, but the SQL statement fails during this process.

Am I missing something, why does it work when the COBOL progam is invoked without using the stored procedure, but not when the stored procedure is the start of the process?

Here is a copy of the stored procedure.

DROP PROCEDURE SpInput; /* Old Store Procedure */
DROP PROCEDURE SpRate;

CREATE PROCEDURE SpRate (
InOut ChadWrk1_1 CHAR(32000),
InOut ChadWrk1_2 CHAR(32000),
InOut ChadWrk1_3 CHAR(32000),
InOut ChadWrk1_4 CHAR(32000),
InOut ChadWrk1_5 CHAR(32000),
InOut ChadWrk1_6 CHAR(7458),
OUT CHARINST_A CHAR(1420),
OUT CHARFEES_A CHAR(260),
OUT BALANCE DECIMAL(9,2))
LANGUAGE CL
SPECIFIC SpRate
NOT DETERMINISTIC
NO SQL
EXTERNAL NAME RATECL
PARAMETER STYLE GENERAL;
Sep 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.