Passing DEFAULT parameter in procedure
580456Jan 15 2008 — edited Jan 15 2008Hello,
I am writing a procedure that is going to be used in a scheduler, and it normally does calculations based on last week's data. However, I would like to place a parameter in it so that people can manually enter a date by which they can make the same calculations. I tried using DEFAULT in the procedure's declaration, but since the default is a moving target as well (always the previous week), I would like to pass it as a variable. PL/SQL doesn't seem to like it, and gives me a "PLS-00320: the declaration of the type of this expression is incomplete or malformed."
Code is similar to the following:
CREATE PROCEDURE filter(p_date DATE DEFAULT v_date)
IS
v_DATE date;
BEGIN
SELECT validdate
INTO v_date
FROM datetable
WHERE ...
END;