Hi All,
we have a below procedure and when we run it and try to get date as out parameter, we are getting "ORA-01861: literal does not match format string" error,
CREATE OR REPLACE PROCEDURE test_proc ( p_date OUT DATE )
AS
BEGIN
SELECT
TO_CHAR(
SYSDATE,
'yyyy-mm-dd'
)
INTO
p_date
FROM
dual;
dbms_output.put_line('Date: ' || p_date);
/*EXCEPTION
WHEN OTHERS THEN
p_date := NULL;*/
END;
Getting below error,
DECLARE
p_date DATE;
BEGIN
test_proc(p_date);
END;
Error report -
ORA-01861: literal does not match format string
ORA-06512: at "XXCCT.TEST_PROC", line 4
ORA-06512: at line 4
01861. 00000 - "literal does not match format string"
*Cause: Literals in the input must be the same length as literals in
the format string (with the exception of leading whitespace). If the
"FX" modifier has been toggled on, the literal must match exactly,
with no extra whitespace.
*Action: Correct the format string to match the literal.
Please suggest.
Thanks.