Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. InSQL = 'SELECT * from database2.table2 '
  2. sqlOut = pd.read_sql(InSQL,cxn)
  3. sqlOut['_id'] = "20170101" + ":"+ sqlOut['Var']
  4.  
  5. dfOut = sqlOut.to_json(orient='records',date_format='iso' )
  6. try:
  7. db["test"].insert_many(json.loads(dfOut))
  8. except Exception as e: print e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement