Using Default Parameter values with Functions or Procedures?
davejjjMar 20 2013 — edited Mar 21 2013If you have a procedure or function that has DEFAULT values declared for some of the parameters how do you call that function or procedure when you want to use some of the default values? I tried...
myProcedure(202,,);
myProcedure(202,'','');
myProcedure(202,null,null);
myProcedure(job_id=202);
myProcedure(job_id=>202);
None of the above worked.
PROCEDURE add_job (job_id IN jobs.job_id%TYPE
,job_loc IN jobs.job_location%TYPE DEFAULT 145
,mgr_id IN jobs.mgr_id%TYPE DEFAULT 30
);
Thanks.
EDIT -- Let me say this is a simplified example. Please imagine a much larger parameter list with perhaps half having DEFAULT values. Thanks.
PROCEDURE myProcedure (job_id IN jobs.job_id%TYPE
,job_loc IN jobs.job_location%TYPE DEFAULT 145
,mgr_id IN jobs.mgr_id%TYPE DEFAULT 30
,init_id IN jobs.init_id%TYPE
,sal_id IN jobs.sal_id%TYPE DEFAULT 100
,clock_id IN jobs.clock_id%TYPE DEFAULT 'A'
,shift_id IN jobs.shift_id%TYPE
,lot_id IN jobs.lot_id%TYPE DEFAULT 'BACK'
);
Edited by: davejjj on Mar 20, 2013 4:47 PM