Repository: trafodion Updated Branches: refs/heads/master 8697d9262 -> 5f230e24f
add documentation for uuid() Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/694d6d40 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/694d6d40 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/694d6d40 Branch: refs/heads/master Commit: 694d6d407a6def098dfbac4223c0404b852d7081 Parents: 6bd3564 Author: LiuMing <[email protected]> Authored: Sun Aug 19 17:10:51 2018 +0800 Committer: LiuMing <[email protected]> Committed: Sun Aug 19 17:10:51 2018 +0800 ---------------------------------------------------------------------- .../sql_functions_and_expressions.adoc | 38 +++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/694d6d40/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 5dce089..29cb4a5 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 @@ -442,7 +442,8 @@ the expressions have NULL values, the function returns a NULL value. | <<nvl_function,NVL Function>> | Returns the value of the first operand unless it is NULL, in which case it returns the value of the second operand. | <<user_function,USER Function>> | Returns either the database user name of the current user who invoked the function or the database user name associated with the specified user ID number. -| <<sys_guid_function,SYS_GUID Function>> | Returns a globally unique identifier. +| <<sys_guid_function,SYS_GUID Function>> | Returns a globally unique identifier. (Oracle extention) +| <<uuid_function,UUID Function>> | Returns a globally unique identifier. |=== See the individual entry for the function. @@ -11291,6 +11292,41 @@ ID ``` <<< +[[uuid_function]] +== UUID Function +Returns a Universal Unique Identifier (UUID) generated according to RFC 4122. +A UUID is designed as a number that is globally unique in space and time. +Two calls to UUID() are expected to generate two different values, even if +these calls are performed on two separate devices not connected to each other. + +NOTE: But UUID() can only be used in SELECT list, or very simple expressions to get a UUID. +Do not use it in WHERE clause, the behavior is non-deterministic. + + +``` +UUID () +``` + +[[data_type_of_the_result]] +==== Data Type of the Result + +The data type of the result is always CHAR(36). + +[[examples_of_uuid]] +=== Examples of UUID + +* Returns a global unique identifier ++ +``` +SELECT UUID() AS ID FROM dual; + +ID +------------------------- + 6ccd780c-baba-1026-9564-5b8c656024db +--- 1 row(s) selected. +``` + +<<< [[variance_function]] == VARIANCE Function
