db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r923227 - in /db/derby/docs/trunk/src/tools: rtoolsijcomref12333.dita rtoolsijcomref30679.dita rtoolsijcomref36618.dita rtoolsijcomref37862.dita rtoolsijcomref40155.dita rtoolsijcomref62772.dita
Date Mon, 15 Mar 2010 13:51:00 GMT
Author: chaase3
Date: Mon Mar 15 13:50:59 2010
New Revision: 923227

URL: http://svn.apache.org/viewvc?rev=923227&view=rev
Log:
DERBY-4567: Update the Tools documentation to describe the qualified identifiers which Sylvain
just added to ij

Modified 6 topics in the Tools manual.

Patch: DERBY-4567-4.diff

Modified:
    db/derby/docs/trunk/src/tools/rtoolsijcomref12333.dita
    db/derby/docs/trunk/src/tools/rtoolsijcomref30679.dita
    db/derby/docs/trunk/src/tools/rtoolsijcomref36618.dita
    db/derby/docs/trunk/src/tools/rtoolsijcomref37862.dita
    db/derby/docs/trunk/src/tools/rtoolsijcomref40155.dita
    db/derby/docs/trunk/src/tools/rtoolsijcomref62772.dita

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref12333.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref12333.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref12333.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref12333.dita Mon Mar 15 13:50:59 2010
@@ -20,7 +20,8 @@ limitations under the License.
 <reference id="rtoolsijcomref12333" xml:lang="en-us">
 <title>Prepare command</title>
 <prolog><metadata>
-<keywords><indexterm>Prepare command</indexterm><indexterm>Prepared
statements<indexterm>preparing</indexterm></indexterm>
+<keywords><indexterm>Prepare command</indexterm>
+<indexterm>Prepared statements<indexterm>creating</indexterm></indexterm>
 </keywords>
 </metadata></prolog>
 <refbody>
@@ -34,8 +35,11 @@ Use the <xref href="rtoolsijcomref33373.
 to remove the previous statement first. If there are any errors in preparing
 the statement, no prepared statement is created. </p> <p>Any SQL statements
 allowed in the underlying connection's prepared statement can be prepared
-with this command.</p> </section>
-<example><title>Example</title> <codeblock>ij&gt; <b>prepare
seeMenu as 'SELECT * FROM menu';</b>
+with this command.</p>
+<p>If the <i>Identifier</i> specifies a <i>connectionName</i>,
the statement is
+prepared on the specified connection.</p></section>
+<example><title>Examples</title> 
+<codeblock>ij&gt; <b>prepare seeMenu as 'SELECT * FROM menu';</b>
 ij&gt; <b>execute seeMenu;</b>
 COURSE    |ITEM                |PRICE          
 -----------------------------------------------
@@ -43,6 +47,28 @@ entree    |lamb chop           |14      
 dessert   |creme brulee        |6
 
 2 rows selected
-ij&gt; </codeblock> </example>
+ij&gt; </codeblock> 
+<codeblock>ij&gt; <b>connect 'jdbc:derby:firstdb;create=true';</b>
+ij&gt; <b>create table firsttable (id int primary key,
+    name varchar(12));</b>
+0 rows inserted/updated/deleted
+ij&gt; <b>insert into firsttable values 
+    (10,'TEN'),(20,'TWENTY'),(30,'THIRTY');</b>
+3 rows inserted/updated/deleted
+ij&gt; <b>select * from firsttable;</b>
+ID         |NAME        
+------------------------
+10         |TEN         
+20         |TWENTY      
+30         |THIRTY      
+
+3 rows selected
+ij&gt; <b>connect 'jdbc:derby:seconddb;create=true';</b>
+ij(CONNECTION1)&gt; <b>create table newtable (newid int primary key, 
+    newname varchar(12));</b>
+0 rows inserted/updated/deleted
+ij(CONNECTION1)&gt; <b>prepare src@connection0 as 'select * from firsttable';</b>
+ij&gt; </codeblock>
+</example>
 </refbody>
 </reference>

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref30679.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref30679.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref30679.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref30679.dita Mon Mar 15 13:50:59 2010
@@ -24,16 +24,15 @@ limitations under the License.
 </keywords>
 </metadata></prolog>
 <refbody>
-<refsyn><title>Syntax</title> <codeblock><b>EXECUTE { <b><i>SQLString</i></b>
| <b><i>PreparedStatementIdentifier</i></b> }
-[ USING { <b><i>String</i></b> | <b><i>Identifier</i></b>
} ]</b></codeblock> </refsyn>
+<refsyn><title>Syntax</title> <codeblock><b>EXECUTE { <i>SQLString</i>
| <i><xref href="rtoolsijcomref40155.dita#rtoolsijcomref40155">PreparedStatementIdentifier</xref></i>
}
+[ USING { <i><xref href="rtoolsijcomref34110.dita#rtoolsijcomref34110">String</xref></i>
| <i><xref href="rtoolsijcomref40155.dita#rtoolsijcomref40155">Identifier</xref></i>
} ]</b></codeblock> </refsyn>
 <section><title>Description</title> <p>Has several uses:   <ul>
-<li>To execute an SQL command entered as <i>SQLString</i>, using the <xref
-href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref> <i>String</i>
style.
+<li>To execute an SQL command entered as <i>SQLString</i>, using the Execute
<i>String</i> style.
 The String is passed to the connection without further examination or processing
 by <codeph>ij</codeph>. <i>Normally, you execute SQL commands directly,
not
-with the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>
command</i>.</li>
+with the Execute command</i>.</li>
 <li>To execute a named command identified by <i>PreparedStatementIdentifier</i>.
-This must be previously prepared with the <codeph>ij</codeph> <xref href="rtoolsijcomref12333.dita#rtoolsijcomref12333">Prepare</xref>
command.</li>
+This must be previously prepared with the <codeph>ij</codeph>&nbsp;<xref
href="rtoolsijcomref12333.dita#rtoolsijcomref12333">Prepare</xref> command.</li>
 <li>To execute either flavor of command when that command contains dynamic
 parameters, specify the values in the Using portion of the command. In this
 style, the <i>SQLString</i> or previously prepared <i>PreparedStatementIdentifier</i>
is
@@ -41,23 +40,64 @@ executed using the values supplied as <i
 The <i>Identifier</i> in the USING clause must have a result set as its result.
 Each row of the result set is applied to the input parameters of the command
 to be executed, so the number of columns in the Using's result set must match
-the number of input parameters in the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>'s
-statement. The results of each execution of the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>
statement
+the number of input parameters in the Execute's
+statement. The results of each execution of the Execute statement
 are displayed as they are made. If the Using's result set contains no rows,
-the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>'s
+the Execute's
 statement is not executed.   <p>When auto-commit mode is on, the Using's result
-set is closed upon the first execution of the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>
statement.
-To ensure multiple-row execution of the <xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679">Execute</xref>
command,
+set is closed upon the first execution of the Execute statement.
+To ensure multiple-row execution of the Execute command,
 use the <xref href="rtoolsijcomref25753.dita#rtoolsijcomref25753">Autocommit</xref>
command
 to turn auto-commit off.</p></li>
 </ul></p> </section>
-<example><title>Example</title> <codeblock>ij&gt;<b> autocommit
off;</b>
+<example><title>Examples</title> <codeblock>ij&gt;<b> autocommit
off;</b>
 ij&gt; <b>prepare menuInsert as 'INSERT INTO menu VALUES (?, ?, ?)';</b>
 ij&gt;<b> execute menuInsert using 'VALUES
     (''entree'', ''lamb chop'', 14),
     (''dessert'', ''creme brulee'', 6)';</b>
 1 row inserted/updated/deleted
 1 row inserted/updated/deleted
-ij&gt; <b>commit;</b> </codeblock> </example>
+ij&gt; <b>commit;</b> </codeblock> 
+<codeblock>ij&gt; <b>connect 'jdbc:derby:firstdb;create=true';</b>
+ij&gt; <b>create table firsttable (id int primary key,
+    name varchar(12));</b>
+0 rows inserted/updated/deleted
+ij&gt; <b>insert into firsttable values 
+    (10,'TEN'),(20,'TWENTY'),(30,'THIRTY');</b>
+3 rows inserted/updated/deleted
+ij&gt; <b>select * from firsttable;</b>
+ID         |NAME        
+------------------------
+10         |TEN         
+20         |TWENTY      
+30         |THIRTY      
+
+3 rows selected
+ij&gt; <b>connect 'jdbc:derby:seconddb;create=true';</b>
+ij(CONNECTION1)&gt; <b>create table newtable (newid int primary key, 
+    newname varchar(12));</b>
+0 rows inserted/updated/deleted
+ij(CONNECTION1)&gt; <b>prepare src@connection0 as 'select * from firsttable';</b>
+ij(CONNECTION1)&gt; <b>autocommit off;</b>
+ij(CONNECTION1)&gt; <b>execute 'insert into newtable(newid, newname) 
+    values(?,?)' using src@connection0;</b>
+1 row inserted/updated/deleted
+1 row inserted/updated/deleted
+1 row inserted/updated/deleted
+ij(CONNECTION1)&gt; <b>commit;</b>
+ij(CONNECTION1)&gt; <b>select * from newtable;</b>
+NEWID      |NEWNAME     
+------------------------
+10         |TEN         
+20         |TWENTY      
+30         |THIRTY      
+
+3 rows selected
+ij(CONNECTION1)&gt; <b>show connections;</b>
+CONNECTION0 -   jdbc:derby:firstdb
+CONNECTION1* -  jdbc:derby:seconddb
+ij(CONNECTION1)&gt; <b>disconnect connection0;</b>
+ij&gt; </codeblock>
+</example>
 </refbody>
 </reference>

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref36618.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref36618.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref36618.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref36618.dita Mon Mar 15 13:50:59 2010
@@ -27,8 +27,6 @@ limitations under the License.
 <codeblock><b>GET [WITH {HOLD|NOHOLD}] CURSOR <b><i><xref href="rtoolsijcomref40155.dita#rtoolsijcomref40155">Identifier</xref></i></b>
AS <b><i><xref href="rtoolsijcomref34110.dita#rtoolsijcomref34110">String</xref></i></b></b></codeblock>
 <p>WITH HOLD is the default attribute of the cursor. For a non-holdable cursor,
 use the WITH NOHOLD option.</p>
-<note>WITH NOHOLD is only available in Java 2 Platform, Standard
-Edition, v 1.4 (J2SE) or higher.</note>
 </refsyn>
 <section><title>Description</title>
 <p>Creates a cursor with the name of the <i>Identifier</i> by
@@ -41,11 +39,11 @@ the statement, no cursor is created.</p>
 <p><codeph>ij</codeph> sets the cursor name using a <i>java.sql.Statement.setCursorName</i>
request. Behavior with respect to duplicate cursor names is controlled
 by the underlying database. <ph conref="../conrefs.dita#prod/productshortname"></ph>
does not allow multiple open cursors
 with the same name.</p>
-<p>Once a cursor has been created, the <codeph>ij</codeph> <xref href="rtoolsijcomref11128.dita#rtoolsijcomref11128">Next</xref>
and <xref href="rtoolsijcomref24423.dita#rtoolsijcomref24423">Close</xref> commands
can
+<p>Once a cursor has been created, the <codeph>ij</codeph>&nbsp;<xref
href="rtoolsijcomref11128.dita#rtoolsijcomref11128">Next</xref> and <xref href="rtoolsijcomref24423.dita#rtoolsijcomref24423">Close</xref>
commands can
 be used to step through its rows, and if the connection supports positioned
 update and delete commands, they can be issued to alter the rows.</p>
 </section>
-<example><title>Example</title>
+<example><title>Examples</title>
 <codeblock>ij&gt; -- autocommit needs to be off so that the positioned update
 ij&gt; -- can see the cursor it operates against. 
 ij&gt; <b>autocommit off;</b>
@@ -68,4 +66,31 @@ appetizer |baby greens salad   |7       
 ij&gt;<b> close menuCursor;</b>
 ij&gt;<b> commit;</b>
 ij&gt;</codeblock>
+<codeblock>ij&gt; <b>connect 'jdbc:derby:memory:dummy;create=true;user=john'
+    as john_conn;</b>
+ij&gt; <b>create table john_tbl(c int);</b>
+0 rows inserted/updated/deleted
+ij&gt; <b>insert into john_tbl values(1),(2),(3);</b>
+3 rows inserted/updated/deleted
+ij&gt; <b>connect 'jdbc:derby:memory:dummy;user=fred' as fred_conn;</b>
+ij(FRED_CONN)&gt; <b>get cursor john_cursor@john_conn
+    as 'select * from john_tbl';</b>
+ij(FRED_CONN)&gt; <b>next john_cursor@john_conn;</b>
+C          
+-----------
+1          
+ij(FRED_CONN)&gt; <b>next john_cursor@john_conn;</b>
+C          
+-----------
+2          
+ij(FRED_CONN)&gt; <b>next john_cursor@john_conn;</b>
+C          
+-----------
+3          
+ij(FRED_CONN)&gt; <b>next john_cursor@john_conn;</b>
+No current row
+ij(FRED_CONN)&gt; <b>close john_cursor@john_conn;</b>
+ij(FRED_CONN)&gt; <b>disconnect all;</b>
+ij&gt;
+</codeblock>
 </example></refbody></reference>

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref37862.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref37862.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref37862.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref37862.dita Mon Mar 15 13:50:59 2010
@@ -24,25 +24,49 @@ limitations under the License.
 </metadata>
 </prolog><refbody>
 <refsyn><title>Syntax</title>
-<codeblock><b>ASYNC <b><i><xref href="rtoolsijcomref40155.dita#rtoolsijcomref40155">Identifier</xref>
<xref href="rtoolsijcomref34110.dita#rtoolsijcomref34110">String</xref></i></b></b></codeblock>
+<codeblock><b>ASYNC <b><i><xref href="rtoolsijcomref40155.dita#rtoolsijcomref40155">Identifier</xref>&nbsp;<xref
href="rtoolsijcomref34110.dita#rtoolsijcomref34110">String</xref></i></b></b></codeblock>
 </refsyn>
 <section><title>Description</title>
 <p>The ASYNC command lets you execute
 an SQL statement in a separate thread. It is used in conjunction with the <xref href="rtoolsijcomref17631.dita#rtoolsijcomref17631">Wait
For</xref> command to get the results.</p>
 <p>You supply the SQL statement, which is any valid SQL statement, as a <i>String</i>.
The <i>Identifier</i> you must
-supply for the async SQL statement is used in the <xref href="rtoolsijcomref17631.dita#rtoolsijcomref17631">Wait
For</xref> command and is a case-insensitive <codeph>ij</codeph> identifier;
it
-must not be the same as any other identifier for an async statement on the
-current connection. You cannot reference a statement previously prepared and
-named by the <codeph>ij</codeph> <xref href="rtoolsijcomref12333.dita#rtoolsijcomref12333">Prepare</xref>
command
-in this command.</p>
-<p><codeph>ij</codeph> creates a new thread in the current connection to
issue the
+supply for the async SQL statement is used in the
+<xref href="rtoolsijcomref17631.dita#rtoolsijcomref17631">Wait For</xref>
+command and is a case-insensitive <codeph>ij</codeph> identifier. An identifier
+that does not specify a <i>connectionName</i> must not be the same as any other
+identifier for an async statement on the current connection; an identifier that
+specifies a <i>connectionName</i> must not be the same as any other identifier
+for an async statement on the designated connection. You cannot reference a
+statement previously prepared and named by the
+<codeph>ij</codeph>&nbsp;<xref href="rtoolsijcomref12333.dita#rtoolsijcomref12333">Prepare</xref>
+command in this command.</p>
+<p><codeph>ij</codeph> creates a new thread in the current or designated
connection to issue the
 SQL statement. The separate thread is closed once the statement completes.</p>
 </section>
-<example><title>Example</title>
-<codeblock>ij&gt;<b>async aInsert 'INSERT into menu values (''entree'',''chicken'',11)';</b>
-ij&gt;<b>INSERT INTO menu VALUES ('dessert','ice cream',3);</b>
+<example><title>Examples</title>
+<codeblock>ij&gt; <b>async aInsert 'INSERT into menu values (''entree'',''chicken'',11)';</b>
+ij&gt; <b>INSERT INTO menu VALUES ('dessert','ice cream',3);</b>
 1 rows inserted/updated/deleted.
-ij&gt;<b>wait for aInsert;</b>
+ij&gt; <b>wait for aInsert;</b>
 1 rows inserted/updated/deleted.
--- the result of the asynchronous insert</codeblock>
+-- the result of the asynchronous insert
+</codeblock>
+<codeblock>ij&gt; <b>connect 'jdbc:derby:memory:dummy;create=true;user=john'
+    as john_conn;</b>
+ij&gt; <b>create table john_tbl (c int);</b>
+0 rows inserted/updated/deleted
+ij&gt; <b>insert into john_tbl values(1),(2),(3);</b>
+3 rows inserted/updated/deleted
+ij&gt; <b>connect 'jdbc:derby:memory:dummy;user=fred' as fred_conn;</b>
+ij(FRED_CONN)&gt; <b>async john_async @ john_conn 'select * from john_tbl';</b>
+ij(FRED_CONN)&gt; <b>wait for john_async @ john_conn;</b>
+C          
+-----------
+1          
+2          
+3          
+
+3 rows selected
+ij(FRED_CONN)&gt; 
+</codeblock>
 </example></refbody></reference>

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref40155.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref40155.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref40155.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref40155.dita Mon Mar 15 13:50:59 2010
@@ -21,13 +21,23 @@ limitations under the License.
 <prolog>
 </prolog><refbody>
 <refsyn><title>Syntax</title>
-<codeblock><b><i>Identifier</i></b></codeblock>
+<codeblock><b><i>Identifier</i> [ @ <i>connectionName</i>
]</b></codeblock>
 </refsyn>
 <section><title>Description</title>
 <p>Some <codeph>ij</codeph> commands require identifiers. These <codeph>ij</codeph>
identifiers
 are case-insensitive. They must begin with a letter in the range A-Z, and
 can consist of any number of letters in the range A-Z, digits in the range
 0-9, and underscore (_) characters. </p>
+<p>An identifier can optionally use an at sign (<codeph>@</codeph>) followed
+by a <i>connectionName</i>. Spaces on either side of the <codeph>@</codeph>
sign
+are optional. If you specify a <i>connectionName</i>, you can refer to databases
+on different connections. This capability enables you to perform tasks such as
+copying data from one database to another. For an example of copying data
+between databases, see 
+<xref href="rtoolsijcomref30679.dita#rtoolsijcomref30679"></xref>. For other
+examples, see <xref href="rtoolsijcomref37862.dita#rtoolsijcomref37862"></xref>,
+<xref href="rtoolsijcomref36618.dita#rtoolsijcomref36618"></xref>, and
+<xref href="rtoolsijcomref62772.dita#rtoolsijcomref62772"></xref>.</p>
 <p>These identifiers exist within the scope of <codeph>ij</codeph> only
and are
 distinct from any identifiers used in SQL commands, except in the case of
 the <xref href="rtoolsijcomref36618.dita#rtoolsijcomref36618">Get Cursor</xref>
command. The <xref href="rtoolsijcomref36618.dita#rtoolsijcomref36618">Get Cursor</xref>
command specifies a cursor name to use in creating a result set. </p>
@@ -37,5 +47,7 @@ the <xref href="rtoolsijcomref36618.dita
 <codeblock><b>These are valid ij identifiers:
 foo1
 exampleIdentifier12345
-another_one</b></codeblock>
+another_one
+myId@connection0
+id2 @ connection1</b></codeblock>
 </example></refbody></reference>

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref62772.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref62772.dita?rev=923227&r1=923226&r2=923227&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref62772.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref62772.dita Mon Mar 15 13:50:59 2010
@@ -29,22 +29,20 @@ limitations under the License.
    <b><i><xref href="rtoolsijcomref34110.dita#rtoolsijcomref34110">String</xref></i></b></b></codeblock>
 <p>WITH HOLD is the default attribute of the cursor. For a non-holdable cursor,
 use the WITH NOHOLD option.</p>
-<note>WITH NOHOLD is only available in Java 2 Platform, Standard
-Edition, v 1.4 (J2SE) or higher.</note>
 </refsyn>
 <section><title>Description</title>
-<p>Creates a scrollable insensitive cursor with the name of the <i>Identifier</i>.
(It does this by issuing a <i>createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
-ResultSet.CONCUR_READ_ONLY</i>) call and then executing the statement with <i>java.sql.StatementExecuteQuery</i>
request on the value of
-the String.)  
+<p>Creates a scrollable insensitive cursor with the name of the <i>Identifier</i>.
It does this by issuing a <i>createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+ResultSet.CONCUR_READ_ONLY</i>) call and then executing the statement with a <i>java.sql.StatementExecuteQuery</i>
request on the value of
+the String.
 </p>
 <p>If the <i>String</i> is a statement that does not generate
 a result set, the behavior of the underlying database determines whether an
 empty result set or an error is issued. If there is an error in executing
 the statement, no cursor is created.</p>
-<p>ij sets the cursor name using a <i>java.sql.Statement.setCursorName </i>request.
Behavior with respect to duplicate cursor names is controlled
+<p><codeph>ij</codeph> sets the cursor name using a <i>java.sql.Statement.setCursorName
</i>request. Behavior with respect to duplicate cursor names is controlled
 by the underlying database. <ph conref="../conrefs.dita#prod/productshortname"></ph>
does not allow multiple open cursors
 with the same name.</p>
-<p>Once a scrollable cursor has been created, you can use the follow commands
+<p>Once a scrollable cursor has been created, you can use the following commands
 to work with the result set:  
 <ul>
 <li><xref href="rtoolsijcomref94092.dita#rtoolsijcomref94092"/></li>
@@ -58,10 +56,10 @@ to work with the result set:  
 <li><xref href="rtoolsijcomref97975.dita#rtoolsijcomref97975"/></li>
 </ul></p>
 </section>
-<example><title>Example</title>
+<example><title>Examples</title>
 <codeblock>ij&gt; <b>autocommit off;</b>
 ij&gt; <b>get scroll insensitive cursor scrollCursor as
-'SELECT * FROM menu';</b>
+    'SELECT * FROM menu';</b>
 ij&gt; <b>absolute 5 scrollCursor;</b>
 COURSE    |ITEM                |PRICE
 -----------------------------------------------
@@ -93,5 +91,50 @@ dessert   |creme brulee        |6
 ij&gt; <b>next scrollcursor;</b>
 COURSE    |ITEM                |PRICE
 -----------------------------------------------
-dessert   |creme brulee        |6</codeblock>
+dessert   |creme brulee        |6
+</codeblock>
+<codeblock>
+ij&gt; <b>connect 'jdbc:derby:memory:dummy;create=true;user=john'
+    as john_conn;</b>
+ij&gt; <b>create table john_tbl(c int);</b>
+0 rows inserted/updated/deleted
+ij&gt; <b>insert into john_tbl values(1),(2),(3);</b>
+3 rows inserted/updated/deleted
+ij&gt; <b>connect 'jdbc:derby:memory:dummy;user=fred' as fred_conn;</b>
+ij(FRED_CONN)&gt; <b>get scroll insensitive cursor john_cursor@john_conn 
+    as 'select * from john_tbl';</b>
+ij(FRED_CONN)&gt; <b>next john_cursor@john_conn;</b>
+C          
+-----------
+1          
+ij(FRED_CONN)&gt; <b>getcurrentrownumber john_cursor@john_conn;</b>
+1
+ij(FRED_CONN)&gt; <b>last john_cursor@john_conn;</b>
+C          
+-----------
+3          
+ij(FRED_CONN)&gt; <b>previous john_cursor@john_conn;</b>
+C          
+-----------
+2          
+ij(FRED_CONN)&gt; <b>first john_cursor@john_conn;</b>
+C          
+-----------
+1          
+ij(FRED_CONN)&gt; <b>after last john_cursor@john_conn;</b>
+No current row
+ij(FRED_CONN)&gt; <b>before first john_cursor@john_conn;</b>
+No current row
+ij(FRED_CONN)&gt; <b>relative 2 john_cursor@john_conn;</b>
+C          
+-----------
+2          
+ij(FRED_CONN)&gt; <b>absolute 1 john_cursor@john_conn;</b>
+C          
+-----------
+1          
+ij(FRED_CONN)&gt; <b>close john_cursor@john_conn;</b>
+ij(FRED_CONN)&gt; <b>disconnect all;</b>
+ij&gt;
+</codeblock>
 </example></refbody></reference>



Mime
View raw message