You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
variable names are substituted, and the query plan is cached for
2425
-
possible reuse.
2429
+
possible reuse. The <literal>SCROLL</> and <literal>NO SCROLL</>
2430
+
options have the same meanings as for a bound cursor.
2426
2431
</para>
2427
2432
2428
2433
<para>
@@ -2437,7 +2442,7 @@ OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey;
2437
2442
<title><command>OPEN FOR EXECUTE</command></title>
2438
2443
2439
2444
<synopsis>
2440
-
OPEN <replaceable>unbound_cursor</replaceable> FOR EXECUTE <replaceable class="command">query_string</replaceable>;
2445
+
OPEN <replaceable>unbound_cursor</replaceable> <optional> <optional> NO </optional> SCROLL </optional> FOR EXECUTE <replaceable class="command">query_string</replaceable>;
2441
2446
</synopsis>
2442
2447
2443
2448
<para>
@@ -2447,8 +2452,10 @@ OPEN <replaceable>unbound_cursor</replaceable> FOR EXECUTE <replaceable class="c
2447
2452
<type>refcursor</> variable). The query is specified as a string
2448
2453
expression, in the same way as in the <command>EXECUTE</command>
2449
2454
command. As usual, this gives flexibility so the query can vary
2450
-
from one run to the next.
2451
-
</para>
2455
+
from one run to the next. The <literal>SCROLL</> and
2456
+
<literal>NO SCROLL</> options have the same meanings as for a bound
2457
+
cursor.
2458
+
</para>
2452
2459
2453
2460
<para>
2454
2461
An example:
@@ -2473,6 +2480,9 @@ OPEN <replaceable>bound_cursor</replaceable> <optional> ( <replaceable>argument_
2473
2480
take arguments. These values will be substituted in the query.
2474
2481
The query plan for a bound cursor is always considered cacheable;
2475
2482
there is no equivalent of <command>EXECUTE</command> in this case.
2483
+
Notice that <literal>SCROLL</> and
2484
+
<literal>NO SCROLL</> cannot be specified, as the cursor's scrolling
2485
+
behavior was already determined.
2476
2486
</para>
2477
2487
2478
2488
<para>
@@ -2513,23 +2523,45 @@ OPEN curs3(42);
2513
2523
<title><literal>FETCH</></title>
2514
2524
2515
2525
<synopsis>
2516
-
FETCH <replaceable>cursor</replaceable> INTO <replaceable>target</replaceable>;
2526
+
FETCH <optional> <replaceable>direction</replaceable> FROM </optional> <replaceable>cursor</replaceable> INTO <replaceable>target</replaceable>;
2517
2527
</synopsis>
2518
2528
2519
-
<para>
2520
-
<command>FETCH</command> retrieves the next row from the
2521
-
cursor into a target, which might be a row variable, a record
2522
-
variable, or a comma-separated list of simple variables, just like
2523
-
<command>SELECT INTO</command>. As with <command>SELECT
2524
-
INTO</command>, the special variable <literal>FOUND</literal> can
2525
-
be checked to see whether a row was obtained or not.
2526
-
</para>
2529
+
<para>
2530
+
<command>FETCH</command> retrieves the next row from the
2531
+
cursor into a target, which might be a row variable, a record
2532
+
variable, or a comma-separated list of simple variables, just like
2533
+
<command>SELECT INTO</command>. As with <command>SELECT
2534
+
INTO</command>, the special variable <literal>FOUND</literal> can
2535
+
be checked to see whether a row was obtained or not.
2536
+
</para>
2527
2537
2528
2538
<para>
2529
-
An example:
2539
+
The <replaceable>direction</replaceable> clause can be any of the
2540
+
variants allowed in the SQL <xref linkend="sql-fetch"
2541
+
endterm="sql-fetch-title"> command except the ones that can fetch
0 commit comments