I Defined the following procedure which compiles correctly.
When i call that procedure it returns an error:
ERROR 1292 (22007): Incorrect date value: ''2012-12-30'' for column 'date_part' at row 11
I think the problem is fetching the date from the cursor, how would i solve it??
small description of the code: i am looping through different tables , and gathering information on each partition that may exist in the table (each table is range partitioned by date)
I think you are comparing string with date that’s why you are getting error..
you can use this for comparision:
so your code look like this: