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: Oracle 9 / MySQL date compatibility

Re: Oracle 9 / MySQL date compatibility

From: Steve W <okapi_at_yahoo.com>
Date: 28 Oct 2004 12:38:39 -0700
Message-ID: <f12cd3d1.0410281138.1287a9b3@posting.google.com>


SELECT id
FROM users
WHERE last_login < (sysdate - 1)

Or

UPDATE USERS SET last_login = sysdate

Neither of these port well for compatibility on DBs other than Oracle (and ones that are similar to Oracle specific SQL).

As for stored procedures, the other poster is correct. They don't exist in MySQL 4.1, only 5.0 alpha.

Steve

"Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in message news:<eEXfd.537021$8_6.164712_at_attbi_s04>...
> "Steve W" <okapi_at_yahoo.com> wrote in message
> news:f12cd3d1.0410271142.77ddc802_at_posting.google.com...
> > I'm trying to update an application to support both Oracle 9 (and 10)
> > and MySQL 4.1 and the one area of compatibility that is problematic
> > for me is dates and date math (like sysdate - 1 is yesterday). Does
> > Oracle support more ANSI compatible date to use instead of sysdate and
> > sysdate +/- days?
> >
> > Thanks,
> > Steve
>
> Example please?
>
> If you use stored procs then you won't have this problem since all the logic
> is just a function call into the database.
> Jim
Received on Thu Oct 28 2004 - 14:38:39 CDT

Original text of this message

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