-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executemany does not execute sql statement #403
Comments
Since Maria DB is one of the databases included in the test setup of For diagnosis, if I remember correctly turbodbc has features for logging diagnostics. Have you tried activating it. It is not unlikely that the statement gets executed overall, but for each row there is a warning of why it is not inserted. Best, Markus |
Sorry that I took so long to respond. Tis the season after all. Anyway, I tried looking into the documentation and I culd'nt find anything about logging there. I couldn't find anything on logging when searching it up. So I assumed that you meant odbc logging, so I turned on trace file and reran the program, but no tracefile was made, so I'm at a loss. I'll try to see if theres any other odbc logging I can try, but some help in finding what you mean by logging features would be great. Thanks, and sorry I took so long to respond. |
I did not remember correctly. Checked the code. There is nothing which would give you a hint of anything with a severity below error.
Turns out, I should be sorry, for making you chase a red herring. I would still hypothesize, that the statement actually executes successfully, but each individual row may fail to be inserted. This can have all kinds of reasons, but usually it is a violated constraint. This would be reported by ODBC as Best, |
Hello, I have been testing out turbodbc on a mariadb datebase and its been working out well up until now. For some reason, executemany wont execute sql. It wont spit out an error, it wont freeze or anything at all. The code will execute as if it has executed just fine, but when I check to table to see if it executed, nothing on the table will change at all. I wasn't sure if this was a database issue or a table issue, so I replaced the connector from turbodbc with the connector for pypyodbc. When I run that, it'll work just fine and input the code with executemany. So if this is a turbodbc issue, what is causing issues and what can I do to fix it. Strangely enough, when running executemany with only one tuple set, it will insert it into the table without any issues, but when I do two or more, it will still act just fine, but will not actually insert the data into the table. I am running turbodbc on python-pypy3.9 and on the latest version. of turbodbc. If it has to do with my code, that would also be great to know.
def test():
from turbodbc import connect
connection = connect(dsn='My-Test-Server')
cursor = connection.cursor()
cursor.fast_executemany = True
sql = "INSERT INTO test_table (id, item1, item2) VALUES (?, ?, ?)"
tuples=[(2, 'tst1', 'tst2'), (3, 'tst3', 'tst4')]
cursor.executemany(sql, tuples)
connection.commit()
cursor.close()
connection.close()
test()
The text was updated successfully, but these errors were encountered: