DECLARE
TYPE daysInMonthArray IS VARRAY(12) OF VARCHAR2(2);
days daysInMonthArray;
year1 VARCHAR2(4);
idText VARCHAR2(12);
dayOfMonth NUMBER;
j NUMBER;
dateOfBirth DATE;
daysOfYear NUMBER;
month1 VARCHAR2(4);
BEGIN
daysOfYear := 0;
idText := '900780826v'; -- Enter your NIC number here
days := daysInMonthArray('31','29','31','30','31','30','31','31','30','31','30','31');
year1 := '19' || SUBSTR(idText,0, 2);
daysOfYear := SUBSTR(idText,3, 3);
IF (daysOfYear > 500) THEN
daysOfYear := daysOfYear-500;
END IF;
Wednesday, April 9, 2014
Find birthday from NIC number (Sri Lanka) PL/SQL code
This program is design to find birthday from NIC number (Sri Lanka). Fell free to comment and optimize the code.
Subscribe to:
Posts (Atom)