1,150 pts.
 DB2/400 stored procedures
Can you please tell me how to create stored procedures in AS/400 and when they are to be used?

Software/Hardware used:
ASKED: April 12, 2009  6:12 PM
UPDATED: April 14, 2009  5:25 AM

Answer Wiki:
A stored procedure on the AS/400 is created in any SQL environment (CREATE PROCEDURE). This is a permanent object and like C objects it is recognized by it's name and parameters. Is callable from any SQL environment. Defines the variables to be passed in and returned and return sets. Can contain a body of SQL commands or Can reference a native language pgm (RPGLE, CL, CLLE, CBLLE) These are most frequently used to support external programs (VB, Java, etc.) Here are a few sites located with AS/400 Stored Procedures - hundreds more. http://search400.techtarget.com/generic/0,295582,sid3_gci1049543,00.html http://www.mcpressonline.com/programming/general/as/400-stored-procedures-to-the-rescue.html Phil
Last Wiki Answer Submitted:  April 13, 2009  1:43 pm  by  philpl1jb   44,200 pts.
All Answer Wiki Contributors:  philpl1jb   44,200 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Here is a sample stored procedure SP creating in LIB library with input parameter VAR1.

CREATE PROCEDURE LIB/SP (IN VAR1 CHAR(8))
LANGUAGE SQL
P1: BEGIN
DECLARE [Variables];
..
..
set [Variable] = …;

END P1

 105 pts.