Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in Create Procedure

Status
Not open for further replies.

rps122

Technical User
Jul 17, 2003
2
US
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 &quot;END&quot; was found following &quot;where EMPNO =EmpNum&quot;. Expected tokens may include: &quot;<psm_semicolon>&quot;. LINE NUMBER=1. SQLSTATE=42601

Pls help me to solve this problem and to create a stored procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top