Creating a stored proc in DB2
Posted on 2011-03-15
How can I write a DB2 stored procedure with 1 input parameter? If so, how can I call it. I am new to DB2 and need your help.
The input parameter is dt and datatype is date
I have a bunch of SQL queries like this --
DECLARE GLOBAL TEMPORARY TABLE Session.DATE
(EFFECTIVE_DTE DATE NOT NULL)
ON COMMIT PRESERVE ROWS WITH REPLACE;
Insert into Session.DATE
select * from Session.DATE;
select * from session.DATE d1, id t1
where t1.joining_dt = d1.DATE;
I want to put all these statements into a stored procedure. How can I do it?