Python Forum

Full Version: list the files using query in python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can you let me know how to list the files using the query output in python.

Output:
Input Files In Unix Directory : /DDD_Ext/input/ DDD_SL_NE_WAT_FCT_H001_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H002_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H003_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H004_QUAD_BD_20230225.csv
SELECT
	   distinct(filecode),
	   delimiter,
	   a.country,
	   a.catcode,
	   a.client,
		hierarchynum,
		 notify
	FROM 
	   ddd_mail_addresses a 
	              JOIN ddd_data_types b ON a.categorycode = b.categorycode and a.client = b.client and a.country = b.country
				  JOIN ddd_conversion c ON a.categorycode = c.categorycode and a.client = c.client and a.country = c.country
				  JOIN ddd_hierarchy d ON a.categorycode = d.categorycode and a.client = d.client and a.country = d.country
				  where a.client='NE' and a.categorycode='WAT'  and a.country='SL'


Output :

Output:
Filecode Delimiter Country categorycode Client hierarchynum Email "QUAD" "|" "SL" "WAT" "NE" 1 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 2 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 3 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 4 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 1 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 2 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 3 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 4 "[email protected]"
Using Query need to list the files.
DDD_$country_$client_$categorycode_FCT_H00$hierarchynum_$filecode_BD_20230225.csv