Python Forum
store all variable values into list and insert to sql_summary table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
store all variable values into list and insert to sql_summary table
#1
Hi Team,

I am working on a project, task is
1) extract sql table into csv
2) run chksum on it
3) gzip the file

and final steps to pass all varaibles value into sql_Summary_tables.


how to store all values into a global list , and insert values into sql_Summary_tables.
I am using 4 modules, all variable values lies in different module

I am not using oops concept. created functions in different module and calling. plz help how to achieve this task.


attached sample of office task.

import sys
def main()
	SQL_Table = sys.argv(1)
	Destination_path = sys.argv(2)
	site_Name = sys.argv(3)
	date = sys.argv(4)


	from module1 import Create_csv
	csvname = Create_csv(tblname,SQL_Table,Destination_path)
	
	from module2 import chksum
	x = Create_checksum(tblname,Destination_path)
	
	from module3 import function_gzip
	y = function_gzip((tblname,Destination_path)

	
	from module4 import insert_Records
	sql = """ insert into summary_table([database],tblname,Destination_path,date,chksumNo,Gzip_status)values([database],tblname,Destination_path,date,x,y)

	

if __name__ == "__main__":    
	def main()
Reply


Messages In This Thread
store all variable values into list and insert to sql_summary table - by mg24 - Sep-27-2022, 08:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copying the order of another list with identical values gohanhango 7 1,218 Nov-29-2023, 09:17 PM
Last Post: Pedroski55
  Search Excel File with a list of values huzzug 4 1,312 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Comparing List values to get indexes Edward_ 7 1,244 Jun-09-2023, 04:57 PM
Last Post: deanhystad
  Insert 10gb csv files into sql table via python mg24 2 2,001 Apr-28-2023, 04:14 PM
Last Post: snippsat
  Adding values with reduce() function from the list of tuples kinimod 10 2,783 Jan-24-2023, 08:22 AM
Last Post: perfringo
  user input values into list of lists tauros73 3 1,109 Dec-29-2022, 05:54 PM
Last Post: deanhystad
Photo How to select NULL and blank values from MySQL table into csv python300 9 2,558 Dec-27-2022, 09:43 PM
Last Post: deanhystad
Question Triying to store values from models Larry1888 1 679 Nov-02-2022, 02:08 AM
Last Post: Pedroski55
  Split string using variable found in a list japo85 2 1,342 Jul-11-2022, 08:52 AM
Last Post: japo85
  Insert into SQL Table only when Table is First Created? Extra 4 1,515 Jun-28-2022, 07:50 AM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020