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()


On this page of the site you can watch the video online Python -How to Bulk upload SQL table from Json Data ? with a duration of hours minute second in good quality, which was uploaded by the user Technical RPA 15 July 2020, share the link with friends and acquaintances, this video has already been watched 2,606 times on youtube and it was liked by 16 viewers. Enjoy your viewing!