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

ClientFlag MULTI_STATEMENTS (no replies)

$
0
0
I checked documents, but can't found sample codes of executing multi statements using mysql-connector-python, so need help to correct the following.

```
import mysql.connector
from mysql.connector import ClientFlag

# Connect with the MySQL Server
con = mysql.connector.connect(**CFG)
con.set_client_flags([ClientFlag.MULTI_STATEMENTS])
con.reconnect()

cur = con.cursor()

SQL = "update class set age=123 where name='w1';update class set age=456 where name='w2';"
cur.execute(SQL)

....
```

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>