Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alias - 28 Apr 2005 21:55 GMT
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 .
Serge Rielau - 28 Apr 2005 22:29 GMT
> Hi Guys ,
>           I have to create a procedure which has a cursor declared
[quoted text clipped - 14 lines]
>
> 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
Signature

Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.