db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r620486 - /db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita
Date Mon, 11 Feb 2008 13:58:30 GMT
Author: dyre
Date: Mon Feb 11 05:58:29 2008
New Revision: 620486

URL: http://svn.apache.org/viewvc?rev=620486&view=rev
Log:
DERBY-3289: Bracketed comments should be documented in the Derby Tools and Utilities Guide
Patch contributed by Kim Haase
Patch file: DERBY-3289.diff

Modified:
    db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita

Modified: db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita?rev=620486&r1=620485&r2=620486&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita (original)
+++ db/derby/docs/trunk/src/tools/rtoolsijcomref16653.dita Mon Feb 11 05:58:29 2008
@@ -21,16 +21,67 @@
 <title>Syntax for comments in ij commands</title>
 <prolog></prolog>
 <refbody>
-<refsyn><title>Syntax</title> <codeblock><b>-- <b><i>Text</i></b></b></codeblock>
</refsyn>
+<refsyn><title>Syntax</title> <codeblock><b>-- <i>Text</i></b>
+
+<b>/* <i>Text</i> */</b>
+</codeblock> </refsyn>
 <section><title>Description</title> <p>You can use a double dash
to create
 a comment anywhere within an <codeph>ij</codeph> command line and as permitted
 by the underlying connection within SQL commands. The comment is ended at
 the first new line encountered in the text.</p> <p>Comments are ignored on
-input and have no effect on the output displayed.</p> </section>
-<example><title>Example</title> <codeblock>ij&gt; -- this is
a comment;
+input and have no effect on the output displayed.</p> 
+<p>You can also enclose text in <codeph>/*&nbsp;*/</codeph> characters
to create 
+either one-line or multi-line comments. Nested comments are permitted. 
+For example, you could put lines like the following into a script named
+<codeph>comment.sql</codeph>:
+</p>
+<codeblock>
+/* start the file with a /* nested comment */ and see what happens */
+connect 'jdbc:derby:newdb;create=true';
+values 'hi!';
+create table t (x int);
+/* use a multi-line comment */
+/*
+insert into t values 1, 2, 3;
+insert into t values 4, 5, 6;
+*/
+/* end the file with a comment */
+values 'This is a test';
+/* This is also a test */
+</codeblock></section>
+<example><title>Examples</title> <codeblock>ij&gt; -- this is
a comment;
 -- the semicolons in the comment are not taken as the end
 -- of the command; for that, we put it outside the --:
 <b>;</b>
-ij&gt; </codeblock> </example>
+ij&gt; </codeblock> 
+<codeblock>
+ij&gt; <b>run 'comment.sql';</b>
+ij&gt; /* start the file with a /* nested comment */ and see what happens */
+connect 'jdbc:derby:newdb;create=true';
+ij&gt; values 'hi!';
+1  
+---
+hi!
+
+1 row selected
+ij&gt; create table t (x int);
+0 rows inserted/updated/deleted
+ij&gt; /* use a multi-line comment */
+/*
+insert into t values 1, 2, 3;
+insert into t values 4, 5, 6;
+*/
+/* end the file with a comment */
+values 'This is a test';
+1             
+--------------
+This is a test
+
+1 row selected
+ij&gt; /* This is also a test */
+;
+ij&gt; 
+</codeblock>
+</example>
 </refbody>
 </reference>



Mime
View raw message