MySQL Forums
Forum List  »  InnoDB

Go through two strings with comma in a cursor
Posted by: dongling ding
Date: October 05, 2012 02:09PM

Hello,

I have a stored procedure to do the follow things

There is a table with 3 columns

ID |Last_Modified | Flag
1 |2011-12-11 02:00:00| 0
2 |2011-12-13 02:00:00| 0
3 |2011-12-02 02:00:00| 0
4 |2011-12-12 02:00:00| 0

the stored procedure “getback(String pId, String pLast_Modified). E.g. pId =”1,2,3” and pLast_Modified = “2011-12-11 02:00:00, 2011-12-13 02:00:00, 2011-12-01 02:00:00”.

The logic is that, for the same ID, if the last_modified in the table is later than the passed last_modified, then set the flag for that record to “1”.

I am trying to find out a simple way to construct a cursor to get the records need to be changed to "1". But it has no luck. Is there anybody who did similar thing like this before??

Very appreciated your help!

Tony

Options: ReplyQuote


Subject
Views
Written By
Posted
Go through two strings with comma in a cursor
1466
October 05, 2012 02:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.