Showing posts from February, 2026
Safe Drop Table in PL/SQL BEGIN EXECUTE IMMEDIATE 'DROP TABLE MAIN_SUB_LOC_NZ_BKP PURGE' ; EXCEPTION WHEN OTHERS THEN IF SQLCODE = -942 THEN NULL ; -- table does not exist, ignore ELSE RAISE; …
Indian Financial Year (April–March) ending logic in Oracle SQL . 🇮🇳 Financial Year (April–March) Financial Year: Starts → 01-APR Ends → 31-MAR (next year) ✅ 1. Get Financial Year End Date for a Given Date Example: '15-DEC-2025' SELECT CASE …
In Oracle SQL, you can use the built-in LAST_DAY function. ✅ If you have a date like '01-DEC-2025' SELECT LAST_DAY(TO_DATE('01-DEC-2025','DD-MON-YYYY')) AS LAST_DATE FROM dual; ✅ Output 31-DEC-2025 🔹 If the column is already …
production-safe logic to ensure SMS is sent only between 10:00 AM and 8:00 PM . ✅ Simple & reliable Oracle logic (recommended) AND TO_NUMBER(TO_CHAR(SYSDATE, 'HH24')) BETWEEN 10 AND 19 ✔ Why 19 and not 20? HH24 = 20 means 8:00–8:59 PM “B…