Python -How to Bulk upload SQL table from Json Data ?

Published: 15 July 2020
on channel: Technical RPA
2,606
16

Python -How to update sql table from extracted data .
Here I am updating code for sqlite update
#Sqlite library for performing database Operations
import sqlite3

db = sqlite3.connect('Employee')
cursor = db.cursor()
cursor.execute("DROP TABLE IF EXISTS stocks;")
cursor.execute('''create table stocks (ticker varchar(50),date datetime,open float,high float, low float,close float,volume float,dividends float,closeunadj float,lastupdated datetime)''')
cursor.executemany('insert into stocks values(?,?,?,?,?,?,?,?,?,?)', dataframe)
db.commit()
print('We have inserted', cursor.rowcount, 'records to the table.')
#To Fetch the stock data

To Get connection and execute cursor
conn = sqlite3.connect('Employee')
cursor = conn.cursor()
cursor.execute("SELECT * FROM stocks")
result = cursor.fetchall()
for r in result:
print(r)

cursor.execute("SELECT * FROM stocks")
conn.close()


Watch video Python -How to Bulk upload SQL table from Json Data ? online, duration hours minute second in high quality that is uploaded to the channel Technical RPA 15 July 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,606 times and liked it 16 visitors.