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: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 31 Mar 2004 06:18:28 -0500
Message-ID: <rsKdnXwe9s_7N_fd4p2dnA@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 - 05:18:28 CST

Original text of this message

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