I was also needed to check and validate some input values for my SQL procedure.date
I was end up this post,,,
I did bit different way (Based on Herique-san's post) and would like to share for the future uses.
My version is just create a date type variable and catch the exception when none date value movement. (This will check like 20150229, 20111234 etc)
Best Regard Beri
--Example---
Declare lv_date DATE;
Declare EXIT handler FOR sql_error_code 303
Begin
-- Your error process
End;
lv_date = :iv_key2; --< If iv_key2 is not date, exception 303 will occurs then cacth and process it,,