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
"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?
|
depends on where you will be calling the procedure from
if called from PL/SQL or an environment that is working with real date datatypes, then you should use a date datatype
if called from the web (PL/SQL Gateway) then you should use a varchar2 and do the conversion in the routine -- but you will need to standardize on the date format expected, and do some checking within the routine -- this is a good candidate for a custom 'cv_date()' function that can examine the string and determine the appropriate conversion format to use
if called from an environment that is typically passing thru user input (with no local processing befor or after calling the procedure) then you might consider using a varchar2, but i would recommend using the date datatype
| > 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
see noel's post
|
| Regards
|
| Neil
|
|
;-{ mcs Received on Wed Mar 31 2004 - 05:53:49 CST