Hi,
I'm using forms6i.
I have a text field in my form to enter Year. How can i programmatically check whether the year is valid or not?
I'm doing like this right now
Declare
Format_Error EXCEPTION;
PRAGMA EXCEPTION_INIT(Format_Error, -01830);
conv_year Date;
Begin
If :PYEAR is null then
Msg_Alert('Enter a Year!','I',FALSE);
Else
conv_year := to_date(:PYEAR , 'YYYY');
End if;
Exception
When Format_Error then
Msg_alert('Enter a Valid Year !','E',TRUE);
When Others then
Msg_Alert('Exception '||sqlerrm,'E',TRUE);
End;
Is this the right way to check for a valid year?
Thanks