Advertisement
EddyCZ

Untitled

Sep 5th, 2023
1,713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.91 KB | None | 0 0
  1. -- Created on 18.07.2023 by MARTIN.COUFAL
  2. DECLARE
  3.   -- Local variables here
  4.   i INTEGER;
  5.   CURSOR get_rec_ IS SELECT * FROM Depr_Proposal_History_TAB WHERE COMPANY = 'SCZ' AND
  6. BOOK_ID = 'DAN' AND YEAR = 0;
  7.   attr_ VARCHAR(2000);
  8.   info_ VARCHAR(2000);
  9. BEGIN
  10.  
  11.   IF NOT Database_SYS.Is_Db_Patch_Registered('FIXASS', 000069111.230726) THEN
  12.      FOR oldrec_ IN get_rec_ LOOP
  13.        IF oldrec_.YEAR = 0 THEN
  14.          UPDATE depr_proposal_history_tab
  15.          SET YEAR = 1
  16.          WHERE company = oldrec_.company
  17.          AND   book_id = oldrec_.book_id
  18.          AND   object_id = oldrec_.object_id
  19.          AND   YEAR = oldrec_.YEAR
  20.          AND   period = oldrec_.period
  21.          AND   depreciation_until_date = oldrec_.depreciation_until_date;
  22.          END IF;
  23.        END LOOP;
  24.   COMMIT;
  25.   Database_SYS.Register_Db_Patch('FIXASS', 000069111.230726, 'Modify depr proposal history');
  26.   END IF;    
  27.  
  28. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement