problem with procedure

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

problem with procedure

Post by itsmani1 »

Hello all

I have problem with a procedure. I want to use an if statement with stored procedure
Here is procedure:

Code: Select all

CREATE DEFINER = 'root'@'localhost' PROCEDURE `mytmp`()
    NOT DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN
 select 
   * 
 from
   product 
 where 
   product.product_status = 0;  
END;
 
Now what i want to do is, place an if statement which will check if the expiry date of product is greater then the current date.
if the date is greater then i will change the status of that product.

any help

thank you
Post Reply