From: Daniele Varrazzo Date: Fri, 12 Aug 2022 01:25:15 +0000 (+0200) Subject: docs: fix example and reword around multiple-query statements X-Git-Tag: 3.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=727365c7ec531b87b6941ec39853aad6b8047e8a;p=thirdparty%2Fpsycopg.git docs: fix example and reword around multiple-query statements --- diff --git a/docs/basic/from_pg2.rst b/docs/basic/from_pg2.rst index 29fcec1d4..43d2cd935 100644 --- a/docs/basic/from_pg2.rst +++ b/docs/basic/from_pg2.rst @@ -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 ` 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 `:: + + >>> cur = psycopg.ClientCursor(conn) >>> cur.execute( ... "INSERT INTO foo VALUES (%s); INSERT INTO foo VALUES (%s)", ... (10, 20))