I did this statement and it's ok
SELECT a, b
FROM T_COMMENTS
WHERE DATE_COMMENTS BETWEEN DATE '2014-12-05' AND DATE '2017-05-16'
But I wanted to create a stored procedure and there is a mistake:
CREATE OR REPLACE PROCEDURE FACEBOOK.PR_SEL_ALL_COM_PH
(CONSULTA OUT SYS_REFCURSOR,COD_US INT,INDATE1 IN VARCHAR2, INDATE2 IN VARCHAR2) IS
BEGIN
OPEN CONSULTA FOR SELECT a,b FROM T_COMMENTS WHERE DATE_COMMENTS BETWEEN DATE INDATE1 AND DATE INDATE2;
END;
/
What would be the problem in my stored procedure, thanks in advance. Update 1: I'm using php. When I push date for indate1 and indate2 appears this exception
Warning: oci_execute() [function.oci-execute]: ORA-01861: literal does not match format string
How can I solve that? Thanks in advance.