JSON translated into SQL by python

Aaron G. another.human.factor at gmail.com
Sat Nov 23 06:54:42 CET 2013


I am new to programming python for JSON to SQL and I was wondering why this does not work. All the values for entering the DB are correct. The EnterpriseValue data is not entering the database.

 
#collect data from JSON source at Yahoo
url = ["db", "http://y.ahoo.it/wlB89"]
#check all sites
checkstatus(url[]);
#retrieve EnterpriseValue data from yahoo to DB
url = "http://y.ahoo.it/wlB89"
data = helper.openJSON_URL(url)
#store data
curObservation = data["EnterpriseValue"]

#connect to amazon and post data from Yahoo
conn = inti_psql_amazon("db name", "db user", "password", "db source")
query = "CREATE TABLE temp2 (ID int NOT NULL AUTO_INCREMENT, Enterprise_Value float, PRIMARY KEY(ID));"
query = "INSERT INTO TABLE temp2 (enterprise) VALUES("+ str(curObservation) +");"               
do_query_amazon(conn, query)
close_psql_amazon(conn)



More information about the Python-list mailing list