Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Please Help: ORA-01847 for valid date
Hi
I have written the following stored procedure hoping to extract data from a table. When I call the stored proc using a date like 10-11-2004, I get an error ORA-01847: day of month must be between 1 and last day of month.
Procedure "dynamic"
(
vTABLE_NAME IN CHAR,
vCREATED_DATE IN CHAR,
vREF_CURSOR OUT GLOA.RCT
)
AS
V_STRING VARCHAR2(1000);
BEGIN
V_STRING := 'SELECT XRED, YFER FROM '||vTABLE_NAME||' '||
'WHERE CREATED_DATE = TO_DATE('||vCREATED_DATE||',''DD-MM-YYYY'')'
OPEN vREF_CURSOR FOR V_STRING;
END dynamic;
Received on Tue Feb 22 2005 - 13:06:40 CST