Category : execute

I am trying to update records from my database named Template, Table clients. I get my updated information from a Tkinter Treeview. I am updating any field except user_id which is my primary key. I get a syntax error on cur.execute(sql_command). cur is define as my cursor. # Function to Edit Record def edit_client(): # ..

Read more

I need to create daily price entries for around 100 funds using the Sharesight API. I have a filename.docx file which has around 100 requests.post commands that I’d like to automatically run in python. The .docx has the following text (example for 2 funds): url = ‘https://api.sharesight.com/api/v3/custom_investment/Fund1/prices.json’ data = {‘last_traded_price’:11.06, ‘last_traded_on’:’2021-10-12′} hed = {‘Authorization’: ‘Bearer ..

Read more

I use cursor.executemany for an insert query but it give me this error: Failed executing the operation; Not all parameters were used in the SQL statement. This is my code: data_hashtag = [] for emotion in hashtags_count: hashtag_count_by_emo = hashtags_count[emotion] for hashtag in hashtag_count_by_emo: count= hashtag_count_by_emo[hashtag] data_hashtag.append((emotion, hashtag, count,count)) cursor.executemany("insert into hashtagcount(Emotion, Hashtag, Count) values ..

Read more

con=sqlite3.connect(‘database’) cursor=con.cursor() sql=[("1", "first", "New"),("2", "second", "New"),("3", "third", "New")] cursor.executemany("""insert into table(srnumber, order, type) values(?,?,?)""",sql) for row in cursor.execute(‘select * from table WHERE type ="New"’): print(row) This prints all the newly inserted records only once. I want to be able to print after every insert. After the first insert: 1 first New After the second ..

Read more