-----------------------------HRIS_EMPLOYEES_GRADE_CEILING--------------------------------
CREATE TABLE HRNOC.HRIS_EMPLOYEES_GRADE_CEILING(
GC_ID INTEGER NOT NULL UNIQUE GENERATED BY DEFAULT AS IDENTITY,
SERVICE_EVENT_TYPE_ID DECIMAL(7),
POSITION_ID INTEGER,
EMPLOYEE_ID DECIMAL(7),
DESIGNATION_ID INTEGER,
FUNCTIONAL_LEVEL_EDESC VARCHAR(255),
GRADE_SANKHYA INTEGER,
GRADE_CHANGED_BY INTEGER,
EVENT_DATE DATE,
CREATED_DATE DATE,
MODIFIED_DATE DATE,
REMARKS VARCHAR(255)
);

-----------------------------HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP--------------------------------
CREATE TABLE HRNOC.HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP(
EGC_ID INTEGER NOT NULL UNIQUE GENERATED BY DEFAULT AS IDENTITY,
POSITION_ID INTEGER NOT NULL,
POSITION_TYPE VARCHAR(255),
FUNCTIONAL_LEVEL_EDESC VARCHAR(255),
BASIC_SALARY DECIMAL(9, 2) NULL,
"1DAY_SALARY" DECIMAL(9, 2) NULL,
GRADE_CEILING_NO INTEGER,
CREATED_DATE DATE,
MODIFIED_DATE DATE,
REMARKS VARCHAR(255)
);

---------------------------------INSERT SCRIPT FOR NON TECHNICAL---------------------------------------------
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values (1,1,'Non-Technical','12',62680,2089,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),2,'Non-Technical','11',56030,1868,4,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),3,'Non-Technical','10',49380,1646,8,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),4,'Non-Technical','9',45880,1529,10,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),5,'Non-Technical','8',42380,1413,12,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),6,'Non-Technical','7',40190,1340,12,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),7,'Non-Technical','6',37990,1266,12,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),8,'Non-Technical','5',30200,1007,10,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),9,'Non-Technical','4',28610,954,10,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Non-Technical','V',36140,1205,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Non-Technical','IV',34620,1154,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Non-Technical','III',32720,1091,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Non-Technical','II',28990,966,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Non-Technical','I',25850,862,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Non-Technical','V',34620,1154,7,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Non-Technical','V',34620,1154,7,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Non-Technical','IV',32720,1091,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Non-Technical','IV',32720,1091,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Non-Technical','III',28990,966,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Non-Technical','III',28990,966,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Non-Technical','II',25850,862,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Non-Technical','II',25850,862,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Non-Technical','I',24010,800,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Non-Technical','I',24010,800,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Non-Technical','V',29460,982,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Non-Technical','IV',26710,890,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Non-Technical','III',25210,840,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Non-Technical','II',23830,794,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Non-Technical','I',22680,756,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Non-Technical','V',29460,982,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Non-Technical','V',29460,982,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Non-Technical','IV',26710,890,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Non-Technical','IV',26710,890,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Non-Technical','III',25210,840,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Non-Technical','III',25210,840,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Non-Technical','II',23830,794,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Non-Technical','II',23830,794,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Non-Technical','I',22680,756,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Non-Technical','I',22680,756,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Non-Technical','V',28570,952,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Non-Technical','V',28570,952,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Non-Technical','IV',25850,862,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Non-Technical','IV',25850,862,6,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Non-Technical','III',24010,800,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Non-Technical','III',24010,800,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Non-Technical','II',22680,756,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Non-Technical','II',22680,756,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Non-Technical','I',21480,716,5,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Non-Technical','I',21480,716,5,current_date,null,null);

---------------------------------INSERT SCRIPT FOR TECHNICAL--------------------------------------------------------
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),1,'Technical','12',62680,2089,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),2,'Technical','11',56030,1868,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),3,'Technical','10',49380,1646,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),4,'Technical','9',45880,1529,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),5,'Technical','8',42380,1413,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),6,'Technical','7',40190,1340,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),7,'Technical','6',37990,1266,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),8,'Technical','5',30200,1007,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),9,'Technical','4',28610,954,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Technical','V',36140,1205,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Technical','IV',34620,1154,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Technical','III',32720,1091,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Technical','II',28990,966,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),12,'Technical','I',25850,862,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Technical','V',34620,1154,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Technical','V',34620,1154,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Technical','IV',32720,1091,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Technical','IV',32720,1091,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Technical','III',28990,966,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Technical','III',28990,966,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Technical','II',25850,862,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Technical','II',25850,862,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),14,'Technical','I',24010,800,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),11,'Technical','I',24010,800,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Technical','V',29460,982,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Technical','IV',26710,890,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Technical','III',25210,840,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Technical','II',23830,794,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),16,'Technical','I',22680,756,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Technical','V',29460,982,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Technical','V',29460,982,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Technical','IV',26710,890,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Technical','IV',26710,890,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Technical','III',25210,840,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Technical','III',25210,840,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Technical','II',23830,794,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Technical','II',23830,794,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),17,'Technical','I',22680,756,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),10,'Technical','I',22680,756,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Technical','V',28570,952,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Technical','V',28570,952,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Technical','IV',25850,862,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Technical','IV',25850,862,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Technical','III',24010,800,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Technical','III',24010,800,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Technical','II',22680,756,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Technical','II',22680,756,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),18,'Technical','I',21480,716,2,current_date,null,null);
insert into HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP values ((SELECT MAX(EGC_ID) + 1 from HRIS_EMPLOYEES_GRADE_CEILING_MASTER_SETUP),13,'Technical','I',21480,716,2,current_date,null,null);


---------------------- TRIGGER --- INSERT_IN_HRIS_EMPLOYEES_GRADE_CEILING ------------------
CREATE TRIGGER "HRTESTNOC"."INSERT_IN_HRIS_EMPLOYEES_GRADE_CEILING" AFTER INSERT ON "HRTESTNOC"."HRIS_JOB_HISTORY" REFERENCING NEW ROW MYNEWROW FOR EACH ROW 
BEGIN INSERT 
INTO "HRTESTNOC"."HRIS_EMPLOYEES_GRADE_CEILING" (GC_ID,
	 SERVICE_EVENT_TYPE_ID,
	 POSITION_ID,
	 EMPLOYEE_ID,
	 DESIGNATION_ID,
	 FUNCTIONAL_LEVEL_EDESC,
	 GRADE_SANKHYA,
	 GRADE_CHANGED_BY,
	 EVENT_DATE,
	 CREATED_DATE,
	 MODIFIED_DATE,
	 REMARKS) VALUES( (SELECT
	 ifnull(max(GC_ID),
	0) + 1 
		FROM "HRTESTNOC"."HRIS_EMPLOYEES_GRADE_CEILING"),
	 --MYNEWROW.GC_ID = 1,
:MYNEWROW.SERVICE_EVENT_TYPE_ID,
	 :MYNEWROW.TO_POSITION_ID,
	 :MYNEWROW.EMPLOYEE_ID,
	 :MYNEWROW.TO_DESIGNATION_ID,
	 (SELECT
	 FUNCTIONAL_LEVEL_EDESC 
		FROM HRIS_FUNCTIONAL_LEVELS 
		WHERE FUNCTIONAL_LEVEL_ID = :MYNEWROW.TO_FUNCTIONAL_LEVEL),
	 --Apply for grade sankhya logic here
NULL,
	 NULL,
	 :MYNEWROW.EVENT_DATE,
	 :MYNEWROW.CREATED_DT,
	 CURRENT_DATE,
	 NULL) 
;
 
END 
;