Advertisement
EXTREMEXPLOIT

SQL Query Bot

Oct 28th, 2021
1,020
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from pandas import read_csv
  2.  
  3. FILENAME = 'UPF Riders.csv'
  4. tableName ='headquarters'
  5.  
  6. fileData = read_csv(FILENAME, header=None).to_numpy()
  7.  
  8. for data in fileData:
  9.     code, latitude, longitude, postal_address = data[:4]
  10.     sql_query = f"INSERT INTO {tableName}(code, latitude, longitude, postal_address) VALUES ({code},'{latitude}','{longitude}',"+ '"' + str(postal_address) + '"' + ");"
  11.     print(sql_query)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement