5 pts.
0
Q:
Create a Stored Procedure using CL and RPGLE programs
I have an RPGLE program called from a CL program for database files overrides. I want to call the same programs from a stored prodecure on SQL Server from within a Web application. I am brand new to SQL Server but am pretty good on the AS400.
ASKED: Jun 12 2009  3:17 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
30 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
CREATE PROCEDURE ABCSP(
IN PARM1 CHAR(1),
IN PARM2 NUMERIC(9,0),
IN PARM3 NUMERIC(9,0))
LANGUAGE RPGLE RESULT SET 1
NOT DETERMINISTIC
MODIFIES SQL DATA
EXTERNAL NAME ABCRPG( program name )
PARAMETER STYLE GENERAL

Type of Sp as like SQLSPE

Create and compile your CL on the AS400 as normal. Then from a command line type STRSQL and enter the following code.
CREATE PROCEDURE library/clpgm (IN parm1 DEC(3), IN parm2 CHAR(10))
RESULT SETS 1
EXTERNAL NAME library/clpgm
LANGUAGE CL NOT DETERMINISTIC NO SQL
PARAMETER STYLE GENERAL

You should receive a message back:
Procedure clpgm was created in library

You can have as many IN and OUT parms as you need, the must be exactly defined. Also as long as you don't change your parms you can change the CL on the AS400 and recompile without recreating the procedure. If you need to recreate the procedure it is:
DROP PROCEDURE library/clpgm

Then you can Create it again. I have had problems with using the DEC parms so I always convert them to CHAR in the CL before using.
Last Answered: Aug 26 2009  1:14 PM GMT by Ysantosh   30 pts.
Latest Contributors: Poorboy01   30 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0