Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InSQL = 'SELECT * from database2.table2 '
- sqlOut = pd.read_sql(InSQL,cxn)
- sqlOut['_id'] = "20170101" + ":"+ sqlOut['Var']
- dfOut = sqlOut.to_json(orient='records',date_format='iso' )
- try:
- db["test"].insert_many(json.loads(dfOut))
- except Exception as e: print e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement