RhythmAddict112
Programmer
Hi all. I have a stored proc that compiles without issue....it is below. My problem is the error I receive when I try to run it. I have the feeling there is some syntax error in the SP and I'm just not sure what. Any help would be fantastic.
The stored Procedure is basically taking 3 arguments, and doing a coutn(*) query on them. Specifically, it is taking in a value for the WHERE clause, and two dates eg;
dSubmit between (argument1) and (argument2)
thank you in advance.
This is the error I get when I [attempt to] run it:
This is the entire stored procedure:
The stored Procedure is basically taking 3 arguments, and doing a coutn(*) query on them. Specifically, it is taking in a value for the WHERE clause, and two dates eg;
dSubmit between (argument1) and (argument2)
thank you in advance.
This is the error I get when I [attempt to] run it:
Code:
SQL> execute CountSubmitted.CountSubmitted('7','02-apr-2002','30-apr-2002',:r);
BEGIN CountSubmitted.CountSubmitted('7','02-apr-2002','30-apr-2002',:r); END;
*
ERROR at line 1:
ORA-01840: input value not long enough for date format
ORA-06512: at line 1
SQL>
This is the entire stored procedure:
Code:
CREATE OR REPLACE PACKAGE CountSubmitted
AS
TYPE ref_cur IS REF CURSOR;
PROCEDURE CountSubmitted
(
FRM IN date,
TODATE IN date,
REG IN VARCHAR2,
RC1 IN OUT REF_CUR
);
END;
/
CREATE OR REPLACE PACKAGE BODY CountSubmitted
AS
PROCEDURE CountSubmitted
(
FRM IN date,
TODATE IN date,
REG IN VARCHAR2,
RC1 IN OUT REF_CUR
)
AS
BEGIN
OPEN RC1 FOR 'select count (*) from tbl_OpenWindowRequests WHERE cRegion = ' || reg || ' AND dSubmit BETWEEN ('' || to_char(frm) || '') AND ('' || to_char(todate) || '') ';
END;
END;
/