Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Passing DEFAULT parameter in procedure

580456Jan 15 2008 — edited Jan 15 2008
Hello,

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;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2008
Added on Jan 15 2008
9 comments
617 views