-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuuid-str-func.html
More file actions
54 lines (52 loc) · 2.62 KB
/
uuid-str-func.html
File metadata and controls
54 lines (52 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>UUID_STR Function - SQL Notebook</title>
<link rel="stylesheet" href="sqlnotebook.css">
</head>
<body>
<header>
<table class="nav">
<tr>
<td>
<a href="index.html"><img src="art/SqlNotebookIcon.png" alt="SQL Notebook (logo)" style="width: 58px; height: 58px; float: left; margin-right: 20px;"></a>
</td>
<td>
<a href="index.html" id="title">SQL Notebook</a><br>
<nav>
<ul class="nav">
<li><a href="https://github.com/brianluft/sqlnotebook/releases">Download</a></li>
<li><a href="doc.html"><span id="header-doc-long">Documentation</span><span id="header-doc-short">Docs</span></a></li>
<li><a href="https://github.com/brianluft/sqlnotebook">GitHub</a></li>
</ul>
</nav>
</td>
</tr>
</table>
<hr style="margin-top: 15px; margin-bottom: 15px;">
</header>
<article><div id="article">
<h1><tt>UUID_STR</tt> Function</h1>Converts any <a moz-do-not-send="true" href=
"https://en.wikipedia.org/wiki/Universally_unique_identifier">universally unique identifier (UUID)</a> into a
well-formed, canonically formatted string like "491bf00b-7166-4c78-be23-4cfc15f72e86".<br>
<h2>Syntax</h2><tt>UUID_STR(<i>input</i>)</tt><br>
<h2>Parameters</h2>
<ul>
<li><i>input</i>: text or blob<br>
If <i>input</i> is text, then it must contain exactly 32 hexadecimal digits (0-9, A-F). Optionally, it may contain
hyphens to separate blocks of digits and curly braces at the beginning and end. If <i>input</i> is a blob, then it
must be exactly 16 bytes.<br></li>
</ul>
<h2>Return Value</h2>The <i>input</i> reformatted into a 36-character string like
"491bf00b-7166-4c78-be23-4cfc15f72e86". If <i>input</i> is not a valid UUID, then <tt>NULL</tt> is returned.<br>
<h2>Example</h2>
<pre><i>-- These all print the same thing: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'</i><br>PRINT UUID_STR('A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11');<br>PRINT UUID_STR('{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}');<br>PRINT UUID_STR('a0eebc999c0b4ef8bb6d6bb9bd380a11');<br>PRINT UUID_STR('a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11');<br>PRINT UUID_STR('{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}');<br><br><i>-- Prints 1, because 'foobar' is not a valid UUID.</i><br>PRINT UUID_STR('foobar') IS NULL;<br><br><i>-- Prints 1, because the blob returned by ARRAY() is not a UUID.</i><br>PRINT UUID_STR(ARRAY(1, 2, 3)) IS NULL;<br></pre>
</div></article>
<footer><div id="footer">
<hr>
© 2016-2025 <a href="https://github.com/electroly">Brian Luft</a>
</div></footer>
</body>
</html>