]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: fix example and reword around multiple-query statements
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Aug 2022 01:25:15 +0000 (03:25 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Aug 2022 01:25:15 +0000 (03:25 +0200)
docs/basic/from_pg2.rst

index 29fcec1d4597e105e5b17037d98aecc2010bf724..43d2cd93597ea0b894e54e42408ec4d384f2e5bb 100644 (file)
@@ -116,17 +116,17 @@ One obvious way to work around the problem is to use several `!execute()`
 calls.
 
 There is no such limitation if no parameters are used. As a consequence, you
-can use a :ref:`client-side binding cursor <client-side-binding-cursors>` or
-the `psycopg.sql` objects to compose a multiple query on the client side and
-run them in the same `!execute()` call::
-
+can compose a multiple query on the client side and run them all in the same
+`!execute()` call, using the `psycopg.sql` objects::
 
     >>> from psycopg import sql
     >>> conn.execute(
     ...     sql.SQL("INSERT INTO foo VALUES ({}); INSERT INTO foo values ({})"
     ...     .format(10, 20))
 
-    >>> psycopg.ClientCursor(conn)
+or a :ref:`client-side binding cursor <client-side-binding-cursors>`::
+
+    >>> cur = psycopg.ClientCursor(conn)
     >>> cur.execute(
     ...     "INSERT INTO foo VALUES (%s); INSERT INTO foo VALUES (%s)",
     ...     (10, 20))