I'm new to DB2.I'm trying to create the following stored procedure for sample database.I'm using DB2 7.2 for windows.
create procedure SP_TEST
(IN EmpNum INTEGER,OUT JobID CHAR(12))
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
SELECT JOB into JobID from administrator.employee where EMPNO =EmpNum
END ;
The error I'm getting is
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:SQL0104N An unexpected token "END" was found following "where EMPNO =EmpNum". Expected tokens may include: "<psm_semicolon>". LINE NUMBER=1. SQLSTATE=42601
Pls help me to solve this problem and to create a stored procedure.
create procedure SP_TEST
(IN EmpNum INTEGER,OUT JobID CHAR(12))
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
SELECT JOB into JobID from administrator.employee where EMPNO =EmpNum
END ;
The error I'm getting is
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:SQL0104N An unexpected token "END" was found following "where EMPNO =EmpNum". Expected tokens may include: "<psm_semicolon>". LINE NUMBER=1. SQLSTATE=42601
Pls help me to solve this problem and to create a stored procedure.