Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

migrating multi-line SQL commands from pymysql (no replies)

$
0
0
I've been tasked with migrating from pymsqyl to mysql.connector . . . we have a bunch of code that has multi-line SQL statements that don't run as expected in mysql.connector, viz. only the first command in the multi-line statement gets run . . . Is there a best way to migrate from pymysql to mysql.connector? I've added `client_flags=ClientFlag.MULTI_STATEMENTS` but then I seem to need to add `while connection.next_result(): pass` after every insert/update statement that has multi-line SQL before I can do a commit.

Is there a better way?

Viewing all articles
Browse latest Browse all 384

Trending Articles