Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Passing a date and time to a stored procedure
> Would it be better to accept a varchar2 parameter and do the conversion
> within the procedure itself?
>
> > you will need to pass in a valid date datatype, not a character
(varchar2)
> datatype
> I thought I was but could you provide an example so I can see where I got
it
> wrong
procedure test(dt in date);
possible call is
exec test('21-mar-2004 11:14:24'); -- wrong call (unless your session got
data format set to 'DD-MON-YYYY HH24:MI:SS' with alter session.
exec test(to_date('21-mar-2004 11:14:24','DD-MON-YYYY HH24:MI:SS')); --
correct one.
-- tomekbReceived on Wed Mar 31 2004 - 06:49:12 CST