This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH month_info AS ( | |
SELECT | |
TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE, -2)), 'YYYY-MM') AS prev_month, | |
TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE, -1)), 'YYYY-MM') AS curr_month | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('div').forEach(div => { | |
if (div.innerText.trim() === '>') { | |
div.click(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SERVEROUTPUT ON SIZE 1000000 | |
WHENEVER SQLERROR EXIT FAILURE | |
DECLARE | |
CURSOR c_emp IS | |
SELECT EMP_ID, EMP_NAME | |
FROM EMPLOYEE_LOOKUP | |
WHERE EMP_ID IN (SELECT EMP_ID FROM META_DATA); | |
v_failed_count NUMBER := 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Below is a concise “cheat sheet” that shows each column’s header and the exact formula entered in row 2 of the sample workbook. | |
(Drag each formula down to cover all rows of data.) | |
Excel Column Header text (row 1) Formula in row 2 What it does | |
A Expected Files (A) (data only – no formula) Master list of files you expect to receive. | |
B Loaded Files (B) (data only – no formula) Files that actually arrived/loaded. | |
C Cleaned Expected (C) =LOWER(TRIM(LEFT(A2, FIND(".", A2&".")-1))) • Trims spaces, <br>• converts to lower-case, <br>• removes everything after the first dot → base name. | |
D Cleaned Loaded (D) =LOWER(TRIM(LEFT(B2, FIND(".", B2&".")-1))) Same cleaning logic applied to Column B. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=TEXTJOIN(",", TRUE, IF(($D$2:$D$100=D2)*($F$2:$F$100=F2), $B$2:$B$100, "")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=IFERROR( | |
A2 & " " & SUBSTITUTE( | |
XLOOKUP( | |
TRUE, | |
ISNUMBER(SEARCH($D$1:$D$4, B2)), | |
$E$1:$E$4, | |
"" | |
), | |
"$A", | |
A2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOT=/data/scripts | |
WINDOW=20 # how many lines after the message to check | |
find "$ROOT" -type f -name '*.sh' -print0 | | |
while IFS= read -r -d '' f; do | |
awk -v file="$f" -v window="$WINDOW" ' | |
BEGIN{IGNORECASE=1; saw_loader=0; after_msg=0; left=0} | |
{ | |
if (!saw_loader && $0 ~ /(sql\*loader|sqlldr)/) saw_loader=1 | |
if (saw_loader && !after_msg && $0 ~ /processing is completed/) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=LEFT(A1, FIND("~", SUBSTITUTE(A1,".","~",LEN(A1)-LEN(SUBSTITUTE(A1,".",""))))-1) | |
=LET(s, TRIM(A1), | |
d, LEN(s) - LEN(SUBSTITUTE(s, ".", "")), | |
t, IF(RIGHT(LOWER(s),3)=".gz", d-1, d), | |
IF(t<=0, s, LEFT(s, FIND("§", SUBSTITUTE(s, ".", "§", t)) - 1))) | |
=IFERROR( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SERVEROUTPUT ON | |
DECLARE | |
v_batch_size PLS_INTEGER := 100000; -- 1 lakh | |
v_deleted PLS_INTEGER; | |
v_total PLS_INTEGER := 0; | |
BEGIN | |
LOOP | |
DELETE FROM your_table | |
WHERE ROWNUM <= GREATEST(v_batch_size,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=XLOOKUP(LOWER(TRIM(H2)), LOWER(TRIM(B:B)), A:A, "Not Found") |
OlderNewer