Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stanford.edu!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: DA Morgan <damorgan@x.washington.edu>
Newsgroups: comp.databases.oracle.misc
Subject: Re: A PL/SQL parameter puzzle
Date: Thu, 11 Nov 2004 21:15:33 -0800
Organization: Ye 'Ol Disorganized NNTPCache groupie
Message-ID: <1100236456.188297@yasure>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <BDB9372A.A0B5%crwarman@yahoo.com>
In-Reply-To: <BDB9372A.A0B5%crwarman@yahoo.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cache-Post-Path: yasure!unknown@oracle.advtechserv.com
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
X-Complaints-To: abuse@supernews.com
Lines: 35
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:114218

Craig Warman wrote:

> I'm involved in a SQL Server to Oracle migration where we're trying to avoid
> modification of existing SQL statements as much as possible.  This includes
> calls made to SQL Server functions such as "dateadd" which do some simple
> date arithmetic.
> 
> Probably you can see where I'm going with this - I can figure out the
> equivalent Oracle expressions that I'll need in a custom-written PL/SQL
> "dateadd" function.  The part that I'm having trouble with is the
> parameters.  Specifically, calls in the existing SQL to functions like
> dateadd look like this:
> 
>     dateadd(yy,2,some_date_value)
> 
> Yep, no quotes around the yy, which designates that we want to return a date
> two years beyond the given date value.  So I'm trying to come up with a
> nifty sort of way to make those un-quoted parameters work in Oracle.
> 
> I've been mulling over the idea of setting up some sort of synonym for
> things like "yy" that point to constant definitions in a PL/SQL package
> (assuming that would even work), or writing a little one-liner functions
> like "yy" that return a value, but these just seem a bit on the clunky side.
> 
> Anyone have any ideas for something more elegant?
> 
> Craig

I'm with Sybrand. I'll gladly do your project for you, with some of my
students, for 25% of the money you waste on your failed attempt.
-- 
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
