467,868 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,868 developers. It's quick & easy.

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

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
  • viewed: 1462
Share:

Post your reply

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

Similar topics

4 posts views Thread by nicholas | last post: by
2 posts views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
reply views Thread by Richard Silvers | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.