db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r1535369 - /db/derby/docs/trunk/src/ref/rrefsqlj15309.dita
Date Thu, 24 Oct 2013 13:09:27 GMT
Author: chaase3
Date: Thu Oct 24 13:09:27 2013
New Revision: 1535369

URL: http://svn.apache.org/r1535369
Log:
DERBY-6388  Example WHERE CURRENT OF clause in Reference Guide is nonsense

Modified a Reference Manual topic.

Patch: DERBY-6388.diff

Modified:
    db/derby/docs/trunk/src/ref/rrefsqlj15309.dita

Modified: db/derby/docs/trunk/src/ref/rrefsqlj15309.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj15309.dita?rev=1535369&r1=1535368&r2=1535369&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj15309.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj15309.dita Thu Oct 24 13:09:27 2013
@@ -31,12 +31,15 @@ cursors. For more information about upda
 <codeblock><b>WHERE CURRENT OF <i><xref href="rrefcursorname.dita#rrefcursorname">cursorName</xref></i></b></codeblock>
 </refsyn>
 <example><title>Example</title>
-<codeblock expanse="column">Statement s = conn.createStatement();
-s.setCursorName("AirlinesResults");
-ResultSet rs = conn.executeQuery(
-    "SELECT Airline, basic_rate " +
-    "FROM Airlines FOR UPDATE OF basic_rate");
+<codeblock>conn.setAutoCommit(false);
+
+Statement s = conn.createStatement();
+s.setCursorName("AIRLINESRESULTS");
+ResultSet rs = s.executeQuery(
+        "SELECT Airline, basic_rate " +
+        "FROM Airlines FOR UPDATE OF basic_rate");
+rs.next();
 Statement s2 = conn.createStatement();
 s2.executeUpdate("UPDATE Airlines SET basic_rate = basic_rate " +
-    "+ .25 WHERE CURRENT OF AirlinesResults");</codeblock>
+        "+ .25 WHERE CURRENT OF AirlinesResults");</codeblock>
 </example></refbody></reference>



Mime
View raw message