Purpose : Used to update table column:
DECLARE
CURSOR C1
IS
SELECT EMPLOYEENAME,EMPLOYEECODE
FROM ATI_PMIS_EMPLOYEE
WHERE EMPLOYEECODE IN (SELECT POLICE_BP_NO FROM OP_REGISTRATION
WHERE FULL_NAME IS NULL
AND POLICE_BP_NO IS NOT NULL
AND REL_ID=0)
AND EMPLOYEENAME IS NOT NULL;
BEGIN
FOR I IN C1 LOOP
UPDATE OP_REGISTRATION
SET FULL_NAME=I.EMPLOYEENAME
WHERE POLICE_BP_NO=I.EMPLOYEECODE;
COMMIT;
END LOOP;
END;
DECLARE
CURSOR C1
IS
SELECT EMPLOYEENAME,EMPLOYEECODE
FROM ATI_PMIS_EMPLOYEE
WHERE EMPLOYEECODE IN (SELECT POLICE_BP_NO FROM OP_REGISTRATION
WHERE FULL_NAME IS NULL
AND POLICE_BP_NO IS NOT NULL
AND REL_ID=0)
AND EMPLOYEENAME IS NOT NULL;
BEGIN
FOR I IN C1 LOOP
UPDATE OP_REGISTRATION
SET FULL_NAME=I.EMPLOYEENAME
WHERE POLICE_BP_NO=I.EMPLOYEECODE;
COMMIT;
END LOOP;
END;
0 comments:
Post a Comment