Re: forms 3.x, Report 1.1 - y2k algorithim

From: Christian Mondrup <scancm_at_biobase.dk>
Date: 22 Feb 1999 09:23:17 GMT
Message-ID: <7ar7m5$n48$1_at_news.net.uni-c.dk>


mcgrathm_at_admin1.tcd.ie wrote:

: Hi,

: does anybody have a list of features of forms 3.x and sql*report : writer 1.1 to be checked when looking at y2k compliance issues?

Long ago I included this procedure into my library of procedures and functions for reference:

DEFINE PROCEDURE   NAME = fix_date
  DEFINITION = <<<
  /*

     Fix a four-digit year date field to presume correct century if
     only two digits entered as shorthand.  See appendix b-19 of the
     oracle developers book.  Adapted to mimic rrrr format functionality.
     From: Robert Fernandes <rfernand_at_llnl.gov>
     Newsgroups: comp.databases.oracle.tools
  */
  PROCEDURE fix_date (fp_date IN OUT DATE) IS
    lv_cur_century  NUMBER(2);
    lv_cur_yr       NUMBER(2);
    lv_fp_date_yr   NUMBER(4);
    lv_work         CHAR(11);

  BEGIN
    lv_cur_century := TO_NUMBER(SUBSTR(TO_CHAR(SYSDATE,'YYYY'),1,2));
    lv_cur_yr      := TO_NUMBER(TO_CHAR(SYSDATE,'YY'));
    lv_fp_date_yr  := TO_NUMBER(TO_CHAR(FP_DATE,'YYYY'));
    IF (lv_fp_date_yr < 100) THEN  /* only 2-digit year entered */
      IF (lv_cur_yr < 50 AND lv_fp_date_yr >= 50) THEN
	lv_cur_century := lv_cur_century - 1;
      ELSIF (lv_cur_yr >= 50 AND lv_fp_date_yr < 50) THEN
	lv_cur_century := lv_cur_century + 1;
      ELSE
	NULL;
      END IF;
      lv_work := TO_CHAR(fp_date,'DD-MON-') ||
		 TO_CHAR(lv_cur_century) ||
		 LPAD(TO_CHAR(lv_fp_date_yr),2,'0');
      fp_date := TO_DATE(lv_work,'DD-MON-YYYY');
    END IF;
  EXCEPTION
    WHEN others THEN
      proc_err('fix_date');
  END;
>>>

ENDDEFINE PROCEDURE Regards

-- 
Christian Mondrup, Computer Programmer
Scandiatransplant, Skejby Hospital, University Hospital of Aarhus
Brendstrupgaardsvej, DK 8200 Aarhus N, Denmark
Phone: +45 89 49 53 01, Telefax: +45 89 49 60 07
Received on Mon Feb 22 1999 - 10:23:17 CET

Original text of this message