Currently, i am new to python. need some help how to check the header file and check whether the values are present in the oracle table. by disregarding the key word in all the columns and check the rest of the columns and create a warning the column is not present in the table.
Input Files :
/DIL_Exts/LK/NE/input
DIL_LK_NE_WAT_FT_H001_QUAD.csv
DIL_LK_NE_WAT_FT_H001_WEEK.csv
DIL_LK_NE_WAT_FT_H002_QUAD.csv
DIL_LK_NE_WAT_FT_H002_WEEK.csv
DIL_LK_NE_WAT_FT_H003_QUAD.csv
DIL_LK_NE_WAT_FT_H003_WEEK.csv
DIL_LK_NE_WAT_FT_H004_QUAD.csv
DIL_LK_NE_WAT_FT_H004_WEEK.csv
DIL_$country_$client_$catcode_FT_H00$hierarchynum_$filecode.csv
Query Used :
Input Passed => client='NE', a.country='LK', a.catcode='WAT'
SELECT
distinct(filecode),
delimiter,
hierarchynum,
notify
FROM
DILx_mail a
JOIN DILx_file_types b ON a.catcode = b.catcode and a.client = b.client and a.country = b.country
JOIN DILx_conversion c ON a.catcode = c.catcode and a.client = c.client and a.country = c.country
JOIN DILx_hierarchy d ON a.catcode = d.catcode and a.client = d.client and a.country = d.country
where a.client='NE' and a.catcode='WAT' and a.country='LK'
Query Output :
FileCode delimier hierarchynum notify
"QUAD" "|" 1 "country@wide.com"
"QUAD" "|" 2 "country@wide.com"
"QUAD" "|" 3 "country@wide.com"
"QUAD" "|" 4 "country@wide.com"
"WEEK" "|" 1 "country@wide.com"
"WEEK" "|" 2 "country@wide.com"
"WEEK" "|" 3 "country@wide.com"
"WEEK" "|" 4 "country@wide.com"
Heder File :
cat DIL_LK_NE_WAT_FT_H001_QUAD_BD_20230225.csv | head -1
parent Key| child Key| Relation Key| Main Key| Unique Key_Dimensinon|Ut Sal|Val Sal|Vol Sal
By neglecting the key words values :
Ut Sal|Val Sal|Vol Sal
Oracle Table :
select * from values
country Client Category_code Values
"LK" "NE" "WAT" "Val Sal"
"LK" "NE" "WAT" "Ut Sal"