Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Functions with date inputs

Functions with date inputs

From: <lisa.sloane_at_gmail.com>
Date: 13 Aug 2005 08:23:48 -0700
Message-ID: <1123946628.750004.261390@g43g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US