Sunday, 15 February 2015

Change Pay Group through Procedure

CREATE OR REPLACE PROCEDURE SUP_TO_VEN AS

  CURSOR C1 IS
    SELECT *
      FROM AP_SUPPLIER_SITES_ALL APSA
     WHERE APSA.PAY_GROUP_LOOKUP_CODE = 'SUPPLIER';
VCOUNT NUMBER :=0;

BEGIN
  FOR I IN C1 LOOP
    UPDATE AP_SUPPLIER_SITES_ALL ASSA
       SET ASSA.PAY_GROUP_LOOKUP_CODE = 'EMPLOYEE'
     WHERE ASSA.VENDOR_ID = I.VENDOR_ID;
    COMMIT;
    VCOUNT := VCOUNT + 1;
  END LOOP;
  DBMS_OUTPUT.put_line('TOTAL RECORDS FOR EMPLOYEED = '||VCOUNT);
end;

No comments:

Post a Comment

Query to Find Receipt Class and its GL Combinition Query

SELECT ARC.NAME ReceiptClass,        ARC.CREATION_METHOD_CODE Creation_Mehthod,        DECODE (ARC.REMIT_METHOD_CODE,             ...