By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,515 Members | 1,682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,515 IT Pros & Developers. It's quick & easy.

how to pass value to a stored procedure at runtime....

P: n/a
Hi Guys ,
I have to create a procedure which has a cursor declared
inside as :

Declare c_1 cursor for select name,dept,sal,desig from employee where
join_date < ( current timestamp - 100 days);
Is it possible to pass the value 100 at the run time ? I m stuck with
the correct syntax to do it but of no avail . I have tried :

Declare c_1 cursor for select name,dept,sal,desig from employee where
join_date < ( current timestamp ||'-'||p_number||' days)';
where p_number is an IN variable of int type.
But its not working .

Please excuse my ignorance as I m new to db2 .

Thanks .

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alias wrote:
Hi Guys ,
I have to create a procedure which has a cursor declared
inside as :

Declare c_1 cursor for select name,dept,sal,desig from employee where
join_date < ( current timestamp - 100 days);
Is it possible to pass the value 100 at the run time ? I m stuck with
the correct syntax to do it but of no avail . I have tried :

Declare c_1 cursor for select name,dept,sal,desig from employee where
join_date < ( current timestamp ||'-'||p_number||' days)';
where p_number is an IN variable of int type.
But its not working .

Please excuse my ignorance as I m new to db2 .

Thanks .

Have you tried the obvious?

Declare c_1 cursor for select name,dept,sal,desig from employee where
join_date < ( current timestamp - p_number days);

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.