I NEED HELP WITH THE NEW CENTURY...
Posted in 1997
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
From dixong@lee-dns2.army.mil Thu 20 Mar 97 16:44:45 Path: news.ind.mh.se!solace!nntp.uio.no!Norway.EU.net!uninett.no!news.global-one.n o!nntp.idgonline.no!usenet From: Nils.Myklebust@idg.no (Nils Myklebust) Newsgroups: comp.databases.informix Subject: Re: I NEED HELP WITH THE NEW CENTURY... Date: Fri, 14 Mar 1997 12:45:31 GMT Organization: NM Data AS Lines: 47 Message-ID: <332944e8.94650410@gate.idg.no> References: <5gbdi1$i4f$1@diana.ibernet.es> Reply-To: Nils.Myklebust@idg.no NNTP-Posting-Host: gatekeeper.idg.no X-Newsreader: Forte Free Agent 1.1/32.230 Xref: news.ind.mh.se comp.databases.informix:46016 Nils.Myklebust@idg.no (Nils Myklebust) wrote: Antonio Julian Lopez <jmg@bitmailer.net> wrote: :We have Informix-SE 4.10 and Informix OnLine 5.02. The tool/language is the important part. I assume you have 4GL. Of course it is an engine issue as well with literal dates, but nobody should expect correct behaviour there without 4 digit years. : To deal with :the next century, we have found some problems that I hope someone :can help us: : :1. Doesn't exists a DBCENTURY variable, or similar, for these : versions of Informix ? No. It doesn't exist until some 7.x version and it's coresponding version of ESQL/C. No version of 4GL is yet out that supports DBCENTURY. I would expect it soon though. Even ISQL (perform screens) should eventually arrive as it becomes critical for the users, but I wouldn't rely on this. :2. If not exists, it's possible to program an easy solution to : avoid the obligation of introduce "4-digit" year in date : fields ? No. Not even a difficult solution is realy possible. (snip) We have solved this by requiring users to key-enter dates into three fields on perform screens - a two-column SMALLINT field (day), a three-column CHAR field (month), and another two-column SMALLINT (year). After the data has been entered it is passed to a library module which validates the data and returns two values - an integer date and an error code. The error code is non-zero if the passed data fails validation (e.g. 32 JAN 99). The passed two-digit year is converted to a full year as follows: If the passed year is 98 - 99 and the last two digits of current year are 00 - 02, then the first two digits of the returned year are set = to the first two digits of the passed year + 1. (If user enters 01 in 1998, 2001 is returned.) If the passed year is 00 - 02 and the last two digits of the current year are 98 - 99, then the first two digits of the returned year are set = to the first two digits of the passed year - 1. (If user enters 99 in 2000, 1999 is returned.) In all other cases, the first two digits of the returned year are set = to the first two digits of the current year. (If user enters 98 in 2003, 2098 is returned.) Of course the "window" may be expanded or contracted to suit. I will be glad to share 4gl code on request. - George