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
Many Thanks Noel and Mark
"zoetosis" <NeilJellis_NoSpam_Please__at_Hotmail.com> wrote in message
news:c4eadv$n7k$1$8302bc10_at_news.demon.co.uk...
> Mark,
>
> 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
>
> Regards
>
> Neil
>
>
> "Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message
> news:rsKdnXwe9s_7N_fd4p2dnA_at_comcast.com...
> >
> > "zoetosis" <NeilJellis_NoSpam_Please__at_Hotmail.com> wrote in message
> > news:c4e7vc$ku6$1$8302bc10_at_news.demon.co.uk...
> > | I need to know how I can accept a date and time such as 31-mar-2004
> > 11:45:12
> > | as a parameter to a stored procedure.
> > | I've looked around but can only find examples of where a date but no
> time
> > | element is passed.
> > |
> > | The parameter is declared thus:
> > | ..., pwdexpiredate_in in useraccount.pwdexpiredate%type, ...
> > |
> > | The parameter will ultimately supply the value to go into a column in
a
> > | table.
> > |
> > | When I run the procedure Oracle complains about the hours element of
the
> > | time.
> > |
> > | Thanks
> > |
> > | Neil
> > |
> > |
> >
> > assuming the useraccount.pwdexpiredate column is defined as a date
> datatype,
> > then the pwdexpiredate_in parameter will also be a date datatype
> >
> > oracle date datatypes include time, to the second
> >
> > you will need to pass in a valid date datatype, not a character
(varchar2)
> > datatype
> >
> > if you are calling your procedure with a literal, you will need to use
the
> > to_date() function to convert your literal (character string) to a
date --
> > specifying both the date value and a corresponding format
> >
> > ;-{ mcs
> >
> >
>
>
Received on Wed Mar 31 2004 - 06:08:41 CST
![]() |
![]() |