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 -> Re: Passing a date and time to a stored procedure

Re: Passing a date and time to a stored procedure

From: Noel <tbal_at_go2.pl>
Date: Wed, 31 Mar 2004 13:49:12 +0100
Message-ID: <c4eav6$lf6$1@inews.gazeta.pl>

> 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.

--
tomekb
Received on Wed Mar 31 2004 - 06:49:12 CST

Original text of this message

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