In Oracle 9i I am trying to assign variables declared as a string to a date field. I am getting the following error:
ORA-01858: a non-numeric character was found where a numeric was expected
The code is as follows:
v_mnth VARCHAR2 DEFAULT NULL,
v_day VARCHAR2 DEFAULT NULL,
v_yr VARCHAR2 DEFAULT NULL
v_date DATE := to_date(v_mnth|| '/' ||v_day || '/' || v_yr,'MM/DD/YYYY');
But, when I hardcode a value for v_mnth, v_day and v_yr I do not get the error.
I do not understand what is wrong.
I appreciate your help in advance.
getjbb
ORA-01858: a non-numeric character was found where a numeric was expected
The code is as follows:
v_mnth VARCHAR2 DEFAULT NULL,
v_day VARCHAR2 DEFAULT NULL,
v_yr VARCHAR2 DEFAULT NULL
v_date DATE := to_date(v_mnth|| '/' ||v_day || '/' || v_yr,'MM/DD/YYYY');
But, when I hardcode a value for v_mnth, v_day and v_yr I do not get the error.
I do not understand what is wrong.
I appreciate your help in advance.
getjbb