ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 3
Statement processed.
ALTER SESSION SET PLSQL_CODE_TYPE = 'NATIVE'
Statement processed.
CREATE OR REPLACE PROCEDURE RAGTEST
AS
FUNCTION is_nls_date
( p_string IN VARCHAR2
, p_format_mask IN VARCHAR2
)
RETURN NUMBER
AS
l_test DATE;
l_return NUMBER := 0;
BEGIN
BEGIN
l_test := TO_DATE(p_string, ''''||p_format_mask||'''');
l_return := 1;
EXCEPTION
WHEN OTHERS THEN
l_return := 0;
END;
--
RETURN l_return;
END is_nls_date;
BEGIN
DBMS_OUTPUT.PUT_LINE('is_date 01.01.xxxx = '||is_nls_date('01.01.xxxx','DD.MM.YYYY'));
DBMS_OUTPUT.PUT_LINE('is_date 01.01.2001 = '||is_nls_date('01.01.2001','DD.MM.YYYY'));
END;
Procedure created.
exec ragtest
is_date 01.01.xxxx = 0
is_date 01.01.2001 = 1