Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Functions with date inputs
I am having a problem creating a function that accepts date input
parameters. This is for my pl/sql class.
I need to create a function called OLTP_NUMBER_SOLD to return number of
car sales from OLTP Sales Table, given a starting and ending date as
input parameters.
this is what I have for my function:
CREATE OR REPLACE FUNCTION OLTP_NUMBER_SOLD (p_start
sales.sale_day%TYPE,
p_end sales.sale_date%TYPE)
RETURN NUMBER
AS
v_count NUMBER;
BEGIN
SELECT COUNT(*)
INTO v_count
FROM SALES
RETURN v_count;
END;
/
--FUNCTION CREATES SUCCESSFULLY
--THEN CALL FUNCTION
BEGIN
DBMS_OUTPUT.PUT_LINE('NO. SOLD = '||OLTP_NUMBERR_SOLD(07-JUL-2005,
27-JUL-2005);
--THEN I recieve error ORA-06650
am I using the wrong date format to call the date? any assistance
greatly appreciated..
thanks
Lisa
Received on Sat Aug 13 2005 - 10:23:48 CDT
![]() |
![]() |