I tried to enter values in a database automatically.
for each table, I list the number of columns that are contained in an xml file, then I'm going to fetch the data in a pandas dataframe
column = ""
values = []
for i, tables in enumerate(bddXml):
for test in range(len(tables[1])):
column += (tables[1][test][0])
values.append(tables[1][test][1])
table = Identifier(str(tables[0]))
column = Identifier(str(column))
value = Identifier(str(a[values].to_string(index=False, header=False)).strip())
cur.execute(SQL("""INSERT INTO {table}({column}) VALUES({value});""").format(table=table,column=column, value=value))
column = []
values = []
when I test my code, it returns this error to me
INSERT INTO "users"("login") VALUES("...")
the problem is due to the ", there should normally be single quote
question from:
https://stackoverflow.com/questions/65902870/executing-requests-double-quote 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…