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:53:49 -0500
Message-ID: <gPOdndgDXbnqLPfd4p2dnA@comcast.com>

"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

Original text of this message

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