Re: Millennial Fun with Oracle Dates

From: Valeri Sorokine <vsorokin_at_dd.ru>
Date: Mon, 10 Jan 2000 13:34:25 +0300
Message-ID: <3879B5B1.EECC56B4_at_dd.ru>


Hi Paul,

You are quite right. Forms uses the current century to expand two-digit date in GLOBAL to four-digit format :-)

So we'd better use set_application_property(plsql_date_format,'DD.MM.YYYY') before using GLOBAL date... :-)

Thank you very much for that interesting information! Hope to hear from you again...

Good Luck!

Valeri

pberetta_at_my-deja.com wrote:
>
> Valeri,
> Forms 4.5 against an Oracle7 database and 5.0 against an Oracle8
> database. Same deal either way. You got the right answer, but you
> asked the wrong question. Try your code, with '01.01.1999' and see
> what happens. As long as the date you are placing in the GLOBAL is in
> the same century as SYSDATE, there is no problem; that's why your test
> worked.
> Paul
>
> In article <38746217.4A81DB1A_at_dd.ru>,
> Valeri Sorokine <vsorokin_at_dd.ru> wrote:
> > Hello Paul,
> >
> > Which version of Oracle Forms do you use?
> >
> > After this code in Forms 6.0.5.33.0:
> >
> > declare
> > tmp_Date DATE;
> > begin
> > :GLOBAL.TEST_DATE := TO_DATE('01.01.2000','DD.MM.YYYY');
> > tmp_Date := :GLOBAL.TEST_DATE;
> > message(TO_CHAR(tmp_Date,'DD.MM.YYYY'));
> > end;
> >
> > I got 01.01.2000 ...
> >
> > Have a Happy Millennium!
> >
> > Valeri
> >
> > pberetta_at_my-deja.com wrote:
> > >
> > > On a (slightly) more serious note, just in case someone out there
> > > has not already been 'bitten' by this one (or figured out what the heck
> > > is going on if they have) -
> > > In Oracle Forms, if you are storing a date to a GLOBAL variable,
> > > then populating a date with the GLOBAL, the results may suprise you now
> > > that we are in 2000. Oracle stores the date to the GLOBAL as a 9
> > > character string in 'DD-MON-YY' format, when it is reconverted to a
> > > DATE, it assumes the current century - not what you want if the
> > > original date was in the 1900's!
> > > Paul

<skip>

-- 
Valeri Sorokine
Oracle Certified Application Developer, Rel.2
ProSoft, Russia, Moscow, Information Systems Division
Phone: +7 (095) 234 0636 ; FAX: +7 (095) 234 0640
E-mail: vsorokin_at_dd.ru   ; http://www.dd.ru
Received on Mon Jan 10 2000 - 11:34:25 CET

Original text of this message