trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/7] incubator-trafodion git commit: Add BLOB and CLOB for *Trafodion SQL Reference Manual*
Date Wed, 20 Dec 2017 21:18:58 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 5635e6399 -> f5e623170


Add BLOB and CLOB for *Trafodion SQL Reference Manual*


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

Branch: refs/heads/master
Commit: 3f09ff5ce425cc004009b44bb1e28f7a51663ce8
Parents: 4639458
Author: liu.yu <yu.liu@esgyn.cn>
Authored: Fri Dec 15 18:28:15 2017 +0800
Committer: liu.yu <yu.liu@esgyn.cn>
Committed: Fri Dec 15 18:28:15 2017 +0800

----------------------------------------------------------------------
 .../sql_functions_and_expressions.adoc          | 106 +++++++++++++++++++
 .../_chapters/sql_language_elements.adoc        |   5 +
 .../src/asciidoc/_chapters/sql_statements.adoc  |   2 +
 3 files changed, 113 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3f09ff5c/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
index d111292..ddcc074 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
@@ -213,6 +213,24 @@ corresponding week of the year.
 
 See the individual entry for the function.
 
+[[lob_functions]]
+== LOB Functions
+
+Trafodion provides following LOB functions to process LOB data.
+
+[cols="25%,75%"]
+|===
+| <<emptyblob_function,EMPTY_BLOB() Function>>   | Creates a dummy LOB handle
with BLOB.
+| <<emptyclob_function,EMPTY_CLOB() Function>>   | Creates a dummy LOB handle
with CLOB.
+| <<stringtolob,STRINGTOLOB>>     | Converts a simple string literal into LOB
format.
+| <<filetolob,FILETOLOB>>         | Converts data from a local linux/hdfs file
into LOB format.
+| <<buffertolob,BUFFERTOLOB>>     | Takes an address and a size of an input buffer,
and converts the data pointed to by that buffer into LOB format.
+| <<externaltolob,EXTERNALTOLOB>> | Converts data from an external file into
LOB format.
+| LOBTOSTRING                     | Converts LOB data into simple string literal.
+| LOBTOFILE                       | Converts LOB data into a linux/hdfs file.
+| LOBTOBUFFER                     | Converts LOB data into a buffer.
+|===
+
 [[mathematical_functions]]
 == Mathematical Functions
 
@@ -3294,6 +3312,12 @@ The results are equivalent to the quotient of the results from the
two
 preceding examples. For example, in the second row of the output of this
 example, 0.0007319 is equal to 21959 divided by 30002620.
 
+<<<
+[[empty_blob() and empty_clob() function]]
+== EMPTY_BLOB() and EMPTY_CLOB() Function
+
+
+
 
 <<<
 [[diff2_function]]
@@ -3406,6 +3430,88 @@ DIFF2_I1TS
 ```
 
 <<<
+[[emptyblob_function]]
+== EMPTY_BLOB() Function
+
+[[syntax_descriptions_of_emptyblob_function]]
+=== Syntax Descriptions of EMPTY_BLOB() Function
+
+The EMPTY_BLOB() function creates a dummy LOB handle with BLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a LOB column or attribute
to EMPTY.
+
+EMPTY_BLOB() function is a Trafodion SQL extension.
+
+For more information, see http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion
LOB Guide].
+
+```
+EMPTY_BLOB()
+```
+
+[[considerations_for_emptyblob_function]]
+=== Considerations for EMPTY_BLOB() Function
+
+* If EMPTY_BLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB handles can later be
used to populate with new LOB data. If the LOB had data previously associated with it, it
will be erased.
+
+** The dummy LOB handle will get the same datatype as the underlying column.
++
+For example, if the LOB column was defined as `‘EXTERNAL’` during table creation, then
the LOB column gets that type. If it’s not defined, then it is considered as a regular LOB.

+
+* An empty LOB is distinct from a LOB containing a string of length zero or a null LOB.
+
+[[examples_of_emptyblob_function]]
+=== Examples of EMPTY_BLOB() Function
+
+* This example uses the EMPTY_BLOB to insert an empty LOB and creates a dummy LOB handle.

++
+```
+insert into test1 values (1, empty_blob());
+```
+
+<<<
+[[emptyclob_function]]
+== EMPTY_CLOB() Function
+
+[[syntax_descriptions_of_emptyclob_function]]
+=== Syntax Descriptions of EMPTY_CLOB() Function
+
+The EMPTY_CLOB() function creates a dummy LOB handle with CLOB.
+
+This function can be used in INSERT or UPDATE statement, to initialize a LOB column or attribute
to EMPTY.
+
+EMPTY_CLOB() function is a Trafodion SQL extension.
+
+For more information, see http://trafodion.incubator.apache.org/docs/lob_guide/index.html[Trafodion
LOB Guide].
+
+```
+EMPTY_CLOB()
+```
+
+[[considerations_for_emptyclob_function]]
+=== Considerations for EMPTY_CLOB() Function
+
+* If EMPTY_CLOB() is specified, then a dummy lob handle is created.
+
+** No data is associated with the empty LOBs yet, but these dummy LOB handles can later be
used to populate with new LOB data. If the LOB had data previously associated with it, it
will be erased.
+
+** The dummy LOB handle will get the same datatype as the underlying column.
++
+For example, if the LOB column was defined as `‘EXTERNAL’` during table creation, then
the LOB column gets that type. If it’s not defined, then it is considered as a regular LOB.

+
+* An empty LOB is distinct from a LOB containing a string of length zero or a null LOB.
+
+[[examples_of_emptyclob_function]]
+=== Examples of EMPTY_CLOB() Function
+
+* This example uses the EMPTY_CLOB to insert an empty LOB and creates a dummy LOB handle.

++
+```
+insert into test2 values (1, empty_clob());
+```
+
+<<<
 [[exp_function]]
 == EXP Function
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3f09ff5c/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
index 36ad0e5..3261020 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
@@ -312,6 +312,8 @@ unique names within a given schema.
 | <<datetime_data_types,Datetime Data Types>>                 | DATE, TIME, and
TIMESTAMP data types.
 | <<interval_data_types,Interval Data Types>>                 | Year-month intervals
(years and months) and day-time intervals (days,
 hours, minutes, seconds, and fractions of a second).
+| <<LOB Data Types,LOB Data Types>>                           | A set of large
object data types used to store large volumes of data, 
+provides random and piece-wise access to the data, such as BLOB and CLOB.
 | <<numeric_data_types_,Numeric Data Types >>                 | Exact and approximate
numeric data types.
 |===
 
@@ -367,6 +369,9 @@ SECOND 0-59 +
 FRACTION(n) 0-999999 +
 in which n is the number of significant digits (default is 6; minimum is 1; maximum is 6);
+
 stored in 2, 4, or 8 bytes depending on number of digits^2^
+.2+| LOB Data Types .2+| LOB | BLOB | Binary Large Object .2+| 10G – no limit + 
+Currently it sets to 10G (default) and it’s controlled by the `CQD LOB_MAX_SIZE`, the size
can be changed depending on your needs.
+| CLOB | Character Large Object 
 .10+| Numeric Data Types .5+| Numeric | NUMERIC (1,_scale_) to + NUMERIC (128,_scale_) |
Binary number with optional scale; signed or unsigned for 1 to 9 digits
 | 1 to 128 digits; +
 stored: +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3f09ff5c/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 7ffd7b9..bab3710 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
@@ -416,6 +416,8 @@ data-type is:
    | time [(time-precision)]
    | timestamp [(timestamp-precision)]
    | interval { start-field to end-field | single-field }
+   | blob [({numeric literal} [unit])] [STORAGE 'storage literal']
+   | clob [({numeric literal} [unit])] [STORAGE 'storage literal']
 
 default is:
      literal


Mime
View raw message