db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r737068 - /db/derby/docs/trunk/src/ref/rrefsqlj13733.dita
Date Fri, 23 Jan 2009 16:18:20 GMT
Author: chaase3
Date: Fri Jan 23 08:18:19 2009
New Revision: 737068

URL: http://svn.apache.org/viewvc?rev=737068&view=rev
Log:
DERBY-4025: CHAR data type documentation fails to describe the maximum allowed length

This patch updates the topic on the CHAR data type to describe the maximum length, remove
a misleading statement, and add another example.

Patch: DERBY-4025-2.diff

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

Modified: db/derby/docs/trunk/src/ref/rrefsqlj13733.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj13733.dita?rev=737068&r1=737067&r2=737068&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj13733.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj13733.dita Fri Jan 23 08:18:19 2009
@@ -26,7 +26,9 @@
 <refbody>
 <section> <p>CHAR provides for fixed-length storage of strings.</p></section>
 <refsyn><title>Syntax</title> <codeblock><b>CHAR[ACTER] [(<i>length</i>)]
</b></codeblock> <p><i>length</i> is
-an unsigned integer constant. The default length for a CHAR is 1.</p> </refsyn>
+an unsigned integer literal designating the length in bytes. The default
+<i>length</i> for a CHAR is 1, and the maximum size of <i>length</i>
is 254.</p>
+</refsyn>
 <section><title>Corresponding compile-time Java type</title> <p><i>java.lang.String</i></p>
</section>
 <section><title>JDBC metadata type (java.sql.Types)</title> <p>CHAR</p>
<p><ph
 conref="../conrefs.dita#prod/productshortname"></ph> inserts spaces to pad
@@ -37,11 +39,17 @@
 of the longer string.</p> <p>When CHARs and VARCHARs are mixed in expressions,
 the shorter value is padded with spaces to the length of the longer value.</p> <p>The
 type of a string constant is CHAR.</p> </section>
-<section><title>Implementation-defined aspects</title> <p>The
-only limit on the length of CHAR data types is the value <i>java.lang.Integer.MAX_VALUE</i>.</p>
</section>
-<example> <codeblock><b><ph>-- within a string constant use two single
quotation marks
+<example><title>Examples</title> <codeblock><b><ph>--
within a string constant use two single quotation marks
 -- to represent a single quotation mark or apostrophe </ph>
-VALUES 'hello this is Joe''s string'</b></codeblock> </example>
+VALUES 'hello this is Joe''s string'</b></codeblock> 
+<codeblock><b>-- create a table with a CHAR field
+CREATE TABLE STATUS (
+    STATUSCODE CHAR(2) NOT NULL
+        CONSTRAINT PK_STATUS PRIMARY KEY,
+    STATUSDESC VARCHAR(40) NOT NULL
+);
+</b></codeblock>
+</example>
 </refbody>
 </reference>
 



Mime
View raw message