Declare
l_invalid_month exception;
pragma exception_init( l_invalid_month, -1843 );
l_date_chr Varchar2(30);
l_trx_date Date;
Begin
l_trx_date := to_date(l_date_chr,'MM/DD/RRRR');
Exception
When l_Invalid_month Then
l_trx_date := to_date(l_date_chr,'DD/MM/RRRR');
End;
Create an exception variable and use exception_init pragma to associate the oracle error code.
No comments:
Post a Comment