Wednesday, February 3, 2021

How to Increase Number in Oracle

declare

cursor c1 is select serialno, trcode, fyear, mdate from gl_transacb where serialno>=107 and trcode='JV' AND FYEAR=18  order by serialno desc;
BEGIN
FOR CR IN C1 LOOP
UPDATE gl_transacb SET SERIALNO=SERIALNO+1 WHERE TRCODE=CR.TRCODE AND FYEAR=CR.FYEAR AND SERIALNO=CR.SERIALNO;
UPDATE gl_SLBATCH SET SERIALNO=SERIALNO+1 WHERE TRCODE=CR.TRCODE AND FYEAR=CR.FYEAR AND SERIALNO=CR.SERIALNO;
UPDATE gl_TRANS_MASTER SET SERIALNO=SERIALNO+1 WHERE TRCODE=CR.TRCODE AND FYEAR=CR.FYEAR AND SERIALNO=CR.SERIALNO;
UPDATE gl_TRANS_DETAIL SET SERIALNO=SERIALNO+1 WHERE TRCODE=CR.TRCODE AND FYEAR=CR.FYEAR AND SERIALNO=CR.SERIALNO;
UPDATE gl_TRANS_SL SET SERIALNO=SERIALNO+1 WHERE TRCODE=CR.TRCODE AND FYEAR=CR.FYEAR AND SERIALNO=CR.SERIALNO;
END LOOP;
END;
/

No comments:

Post a Comment

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...