Repository: trafodion
Updated Branches:
  refs/heads/master caaa2141c -> efd564727


[TRAFODION-3142] Add examples (NCHAR) of *CREATE TABLE Statement* in *Trafodion 
SQL Reference Manual*


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/1fd84078
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/1fd84078
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/1fd84078

Branch: refs/heads/master
Commit: 1fd84078baf3990fae392f55bf01f0c6d0fc6e37
Parents: ab6805d
Author: liu.yu <[email protected]>
Authored: Fri Jul 13 14:05:40 2018 +0800
Committer: liu.yu <[email protected]>
Committed: Fri Jul 13 14:05:40 2018 +0800

----------------------------------------------------------------------
 .../src/asciidoc/_chapters/sql_statements.adoc  | 54 ++++++++++++++++++++
 1 file changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/1fd84078/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc 
b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
index 4b4e9a3..ced4e6d 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
@@ -3712,6 +3712,60 @@ ATTRIBUTES ALIGNED FORMAT
 --- SQL operation complete.
 ```
 
+* This example demonstrates the character set of NCHAR column (_c1_) *cannot 
be specified*.
++
+NOTE: NCHAR or NATIONAL CHAR implicitly assumes that the character set is 
*UCS2*, 
+whether the character set was specified at installation time to be ISO88591 or 
UTF8, 
+and the character set (UCS2) of NCHAR or NATIONAL CHAR *cannot be specified* 
or *altered*. 
+This is true for both *CREATE* and *ALTER* statement.
+
++
+```
+SQL>CREATE TABLE test1 (c1 NCHAR(10) CHARACTER SET USC2);
+
+*** ERROR[15001] A syntax error occurred at or before: 
+create table test1 (c1 nchar(10) character set usc2);
+                                       ^ (40 characters from start of SQL 
statement) [2018-07-13 04:02:39]
+```
+
++
+```
+SQL>CREATE TABLE test1 (c1 NCHAR(10) CHARACTER SET UTF8);
+
+*** ERROR[15001] A syntax error occurred at or before: 
+create table test1 (c1 nchar(10) character set utf8);
+                                       ^ (40 characters from start of SQL 
statement) [2018-07-13 05:53:52]
+```
+
++
+```
+SQL>CREATE TABLE test1 (c1 NCHAR(10) CHARACTER SET ISO88591);
+
+*** ERROR[15001] A syntax error occurred at or before: 
+create table test1 (c1 nchar(10) character set iso88591);
+                                       ^ (40 characters from start of SQL 
statement) [2018-07-13 05:55:47]
+```
+
++
+```
+SQL>CREATE TABLE test1 (c1 nchar(10));
+
+--- SQL operation complete.
+
+
+SQL>SHOWDDL test1;
+ 
+CREATE TABLE TRAFODION.SEABASE.TEST1
+  ( 
+    C1                               CHAR(10) CHARACTER SET UCS2 COLLATE
+      DEFAULT DEFAULT NULL NOT SERIALIZED
+  )
+ ATTRIBUTES ALIGNED FORMAT 
+;
+
+--- SQL operation complete.
+```
+
 <<<
 [[create_table_examples_create_table_as]]
 ==== Examples of CREATE TABLE AS

Reply via email to