Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: A PL/SQL parameter puzzle

Re: A PL/SQL parameter puzzle

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Thu, 11 Nov 2004 21:15:33 -0800
Message-ID: <1100236456.188297@yasure>


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_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Nov 11 2004 - 23:15:33 CST

Original text of this message

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