Skip to content
Advertisement

MySQL Stored Procedures i

I am a Newbee using MySQL Workbench. I have a table Called requests. It has a column called STATUS and another called EXPIREDDATE. I want to create a Stored procedure that Inputs the text “Exipred” into the column STATUS if the date in EXPIREDDATE exceeds Todays date. The begining of the code is below. Thanks.

Advertisement

Answer

Inputs the text “Expired” in to a column A if the date in column B exceeds Todays date

You are describing an update statement with filtering:

You can easily turn this to a stored procedure – although it wouldn’t be very helpful (you can just run the query).

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement