<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – String functions</title>
    <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/</link>
    <description>Recent content in String functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/data-type-specific-functions/string-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: ASCII</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/ascii/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/ascii/</guid>
      <description>
        
        
        &lt;p&gt;Converts the first character of a VARCHAR datatype to an INTEGER. This function is the opposite of the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/chr/#&#34;&gt;CHR&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;ASCII operates on UTF-8 characters and single-byte ASCII characters. It returns the same results for the ASCII subset of UTF-8.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ASCII ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;VARCHAR (string) to convert.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example returns employee last names that begin with L. The ASCII equivalent of L is 76:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT employee_last_name FROM employee_dimension
      WHERE ASCII(SUBSTR(employee_last_name, 1, 1)) = 76
       LIMIT 5;
 employee_last_name
--------------------
 Lewis
 Lewis
 Lampert
 Lampert
 Li
(5 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: BIT_LENGTH</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/bit-length/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/bit-length/</guid>
      <description>
        
        
        &lt;p&gt;Returns the length of the string expression in bits (bytes * 8) as an INTEGER. BIT_LENGTH applies to the contents of VARCHAR and VARBINARY fields.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;BIT_LENGTH ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR or BINARY or VARBINARY) is the string to convert.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;


&lt;strong&gt;Expression&lt;/strong&gt;&lt;/th&gt; 

&lt;th &gt;


&lt;strong&gt;Result&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(&#39;abc&#39;::varbinary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(&#39;abc&#39;::binary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(&#39;&#39;::varbinary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(&#39;&#39;::binary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;8&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(null::varbinary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(null::binary);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(VARCHAR &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(CHAR &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(CHAR(6) &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;48&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(VARCHAR(6) &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(BINARY(6) &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;48&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(BINARY &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(VARBINARY &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT BIT_LENGTH(VARBINARY(6) &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;24&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/character-length/#&#34;&gt;CHARACTER_LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/length/#&#34;&gt;LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/octet-length/#&#34;&gt;OCTET_LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: BITCOUNT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/bitcount/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/bitcount/</guid>
      <description>
        
        
        &lt;p&gt;Returns the number of one-bits (sometimes referred to as set-bits) in the given VARBINARY value. This is also referred to as the population count.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;BITCOUNT ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(BINARY or VARBINARY) is the string to return.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT BITCOUNT(HEX_TO_BINARY(&amp;#39;0x10&amp;#39;));
 BITCOUNT
----------
        1
(1 row)
=&amp;gt; SELECT BITCOUNT(HEX_TO_BINARY(&amp;#39;0xF0&amp;#39;));
 BITCOUNT
----------
        4
(1 row)
=&amp;gt; SELECT BITCOUNT(HEX_TO_BINARY(&amp;#39;0xAB&amp;#39;));
 BITCOUNT
----------
        5
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: BITSTRING_TO_BINARY</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/bitstring-to-binary/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/bitstring-to-binary/</guid>
      <description>
        
        
        &lt;p&gt;Translates the given VARCHAR bitstring representation into a VARBINARY value. This function is the inverse of 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/formatting-functions/to-bitstring/#&#34;&gt;TO_BITSTRING&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;BITSTRING_TO_BINARY ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The VARCHAR string to process.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;If there are an odd number of characters in the hex value, the first character is treated as the low nibble of the first (furthest to the left) byte.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT BITSTRING_TO_BINARY(&amp;#39;0110000101100010&amp;#39;);
 BITSTRING_TO_BINARY
---------------------
 ab
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: BTRIM</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/btrim/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/btrim/</guid>
      <description>
        
        
        &lt;p&gt;Removes the longest string consisting only of specified characters from the start and end of a string.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;BTRIM ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; [ , &lt;span class=&#34;code-variable&#34;&gt;characters-to-remove&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string to modify&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;characters-to-remove&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) specifies the characters to remove. The default is the space character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT BTRIM(&amp;#39;xyxtrimyyx&amp;#39;, &amp;#39;xy&amp;#39;);
 BTRIM
-------
 trim
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/ltrim/#&#34;&gt;LTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/rtrim/#&#34;&gt;RTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/trim/#&#34;&gt;TRIM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CHARACTER_LENGTH</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/character-length/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/character-length/</guid>
      <description>
        
        
        &lt;p&gt;The CHARACTER_LENGTH() function:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Returns the string length in UTF-8 characters for CHAR and VARCHAR columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Returns the string length in bytes (octets) for BINARY and VARBINARY columns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Strips the padding from CHAR expressions but not from VARCHAR expressions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Is identical to &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/length/&#34;&gt;LENGTH()&lt;/a&gt; for CHAR and VARCHAR. For binary types, CHARACTER_LENGTH() is identical to &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/octet-length/&#34;&gt;OCTET_LENGTH()&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt; if &lt;code&gt;USING OCTETS&lt;/code&gt;, &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;stable&lt;/a&gt; otherwise.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[ CHAR_LENGTH | CHARACTER_LENGTH ] ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;... [ USING { CHARACTERS | OCTETS } ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string to measure&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;USING CHARACTERS | OCTETS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Determines whether the character length is expressed in characters (the default) or octets.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT CHAR_LENGTH(&amp;#39;1234  &amp;#39;::CHAR(10) USING OCTETS);
 octet_length
--------------
            4
(1 row)

=&amp;gt; SELECT CHAR_LENGTH(&amp;#39;1234  &amp;#39;::VARCHAR(10));
 char_length
-------------
           6
(1 row)

=&amp;gt; SELECT CHAR_LENGTH(NULL::CHAR(10)) IS NULL;
 ?column?
----------
 t
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/bit-length/#&#34;&gt;BIT_LENGTH&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CHR</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/chr/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/chr/</guid>
      <description>
        
        
        &lt;p&gt;Converts the first character of an INTEGER datatype to a VARCHAR.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CHR ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(INTEGER) is the string to convert and is masked to a single character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;CHR is the opposite of the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/ascii/#&#34;&gt;ASCII&lt;/a&gt; function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CHR operates on UTF-8 characters, not only on single-byte ASCII characters. It continues to get the same results for the ASCII subset of UTF-8.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example returns the VARCHAR datatype of the CHR expressions 65 and 97 from the employee table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT CHR(65), CHR(97) FROM employee;
 CHR | CHR
-----+-----
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
 A   | a
(12 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COLLATION</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/collation/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/collation/</guid>
      <description>
        
        
        &lt;p&gt;Applies a collation to two or more strings. Use &lt;code&gt;COLLATION&lt;/code&gt; with &lt;code&gt;ORDER BY&lt;/code&gt;, &lt;code&gt;GROUP BY&lt;/code&gt;, and equality clauses.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;COLLATION ( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&amp;#39; [ , &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;locale_or_collation_name&lt;/span&gt;&amp;#39; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&#39;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&#39;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Any expression that evaluates to a column name or to two or more values of type &lt;code&gt;CHAR&lt;/code&gt; or &lt;code&gt;VARCHAR&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&#39;&lt;span class=&#34;code-variable&#34;&gt;locale_or_collation_name&lt;/span&gt;&#39;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;http://site.icu-project.org/home&#34;&gt;ICU (International Components for Unicode)&lt;/a&gt; locale or collation name to use when collating the string. If you omit this parameter, &lt;code&gt;COLLATION&lt;/code&gt; uses the collation associated with the session locale.
&lt;p&gt;To determine the current session locale, enter the vsql meta-command &lt;code&gt;\locale&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \locale
en_US@collation=binary
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To set the locale and collation, use &lt;code&gt;\locale&lt;/code&gt; as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \locale en_US@collation=binary
INFO 2567:  Canonical locale: &amp;#39;en_US&amp;#39;
Standard collation: &amp;#39;LEN_KBINARY&amp;#39;
English (United States)
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;locales&#34;&gt;Locales&lt;/h2&gt;
&lt;p&gt;The locale used for &lt;code&gt;COLLATION&lt;/code&gt; can be one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The default locale&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A session locale&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A locale that you specify when you call &lt;code&gt;COLLATION&lt;/code&gt;. If you specify the locale, OpenText™ Analytics Database applies the collation associated with that locale to the data. &lt;code&gt;COLLATION&lt;/code&gt; does not modify the collation for any other columns in the table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a list of valid ICU locales, go to &lt;a href=&#34;http://demo.icu-project.org/icu-bin/locexp&#34;&gt;Locale Explorer (ICU)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;binary-and-non-binary-collations&#34;&gt;Binary and non-binary collations&lt;/h2&gt;
&lt;p&gt;The database default locale is &lt;code&gt;en_US@collation=binary&lt;/code&gt;, which uses &lt;em&gt;&lt;code&gt;binary collation&lt;/code&gt;&lt;/em&gt;. Binary collation compares binary representations of strings. Binary collation is fast, but it can result in a sort order where &lt;code&gt;K&lt;/code&gt; precedes &lt;code&gt;c&lt;/code&gt; because the binary representation of &lt;code&gt;K&lt;/code&gt; is lower than &lt;code&gt;c&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For non-binary collation, the database transforms the data according to the rules of the locale or the specified collation, and then applies the sorting rules. Suppose the locale collation is non-binary and you request a GROUP BY on string data. In this case, the database calls &lt;code&gt;COLLATION&lt;/code&gt; regardless of whether you specify the function in your query.&lt;/p&gt;
&lt;p&gt;For information about collation naming, see &lt;a href=&#34;http://userguide.icu-project.org/collation/concepts#TOC-Collator-naming-scheme&#34;&gt;Collator Naming Scheme&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;collating-group-by-results&#34;&gt;Collating GROUP BY results&lt;/h3&gt;
&lt;p&gt;The following examples are based on a &lt;code&gt;Premium_Customer&lt;/code&gt; table that contains the following data:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM Premium_Customer;
 ID | LName  | FName
----+--------+---------
  1 | Mc Coy | Bob
  2 | Mc Coy | Janice
  3 | McCoy  | Jody
  4 | McCoy  | Peter
  5 | McCoy  | Brendon
  6 | Mccoy  | Cameron
  7 | Mccoy  | Lisa
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first statement shows how &lt;code&gt;COLLATION&lt;/code&gt; applies the collation for the &lt;code&gt;EN_US&lt;/code&gt; locale to the &lt;code&gt;LName&lt;/code&gt; column for the locale &lt;code&gt;EN_US&lt;/code&gt;. Vertica sorts the &lt;code&gt;GROUP BY&lt;/code&gt; output as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Last names with spaces&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Last names where &amp;quot;coy&amp;quot; starts with a lowercase letter&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Last names where &amp;quot;Coy&amp;quot; starts with an uppercase letter&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM Premium_Customer ORDER BY COLLATION(LName, &amp;#39;EN_US&amp;#39;), FName;
 ID | LName  | FName
----+--------+---------
  1 | Mc Coy | Bob
  2 | Mc Coy | Janice
  6 | Mccoy  | Cameron
  7 | Mccoy  | Lisa
  5 | McCoy  | Brendon
  3 | McCoy  | Jody
  4 | McCoy  | Peter
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The next statement shows how &lt;code&gt;COLLATION&lt;/code&gt; collates the &lt;code&gt;LName&lt;/code&gt; column for the locale &lt;code&gt;LEN_AS&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;LEN&lt;/code&gt; indicates the language (L) is English (&lt;code&gt;EN&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AS&lt;/code&gt; (Alternate Shifted) instructs &lt;code&gt;COLLATION&lt;/code&gt; that lowercase letters come before uppercase (shifted) letters.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the results, the last names in which &amp;quot;coy&amp;quot; starts with a lowercase letter precede the last names where &amp;quot;Coy&amp;quot; starts with an uppercase letter.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM Premium_Customer ORDER BY COLLATION(LName, &amp;#39;LEN_AS&amp;#39;), FName;
 ID | LName  | FName
----+--------+---------
  6 | Mccoy  | Cameron
  7 | Mccoy  | Lisa
  1 | Mc Coy | Bob
  5 | McCoy  | Brendon
  2 | Mc Coy | Janice
  3 | McCoy  | Jody
  4 | McCoy  | Peter
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;comparing-strings-with-an-equality-clause&#34;&gt;Comparing strings with an equality clause&lt;/h3&gt;
&lt;p&gt;In the following query, &lt;code&gt;COLLATION&lt;/code&gt; removes spaces and punctuation when comparing two strings in English. It then determines whether the two strings still have the same value after the punctuation has been removed:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT COLLATION (&amp;#39;U.S.A&amp;#39;, &amp;#39;LEN_AS&amp;#39;) = COLLATION(&amp;#39;USA&amp;#39;, &amp;#39;LEN_AS&amp;#39;);
?column?
----------
 t
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;sorting-strings-in-non-english-languages&#34;&gt;Sorting strings in non-english languages&lt;/h3&gt;
&lt;p&gt;The following table contains data that uses the German character eszett, ß:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM t1;
     a      | b | c
------------+---+----
 ßstringß   | 1 | 10
 SSstringSS | 2 | 20
 random1    | 3 | 30
 random1    | 4 | 40
 random2    | 5 | 50
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When you specify the collation &lt;code&gt;LDE_S1&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;LDE&lt;/code&gt; indicates the language (&lt;code&gt;L&lt;/code&gt;) is German (&lt;code&gt;DE&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;S1&lt;/code&gt; indicates the strength (&lt;code&gt;S&lt;/code&gt;) of 1 (primary). This value indicates that the collation does not need to consider accents and case.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The query returns the data in the following order:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT a FROM t1 ORDER BY COLLATION(a, &amp;#39;LDE_S1&amp;#39;));
     a
------------
 random1
 random1
 random2
 SSstringSS
 ßstringß
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: CONCAT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/concat/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/concat/</guid>
      <description>
        
        
        &lt;p&gt;Concatenates two strings and returns a varchar data type. If either argument is null, concat returns null.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CONCAT (&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string-expression1&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression1&lt;/code&gt;&lt;/em&gt;&lt;code&gt;, &lt;/code&gt;&lt;em&gt;&lt;code&gt;string-expression2&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The values to concatenate, any data type that can be cast to a string value.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples use a sample table named &lt;code&gt;alphabet&lt;/code&gt; with two varchar columns:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE alphabet (letter1 varchar(2), letter2 varchar(2));
CREATE TABLE
=&amp;gt; COPY alphabet FROM STDIN;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
&amp;gt;&amp;gt; A|B
&amp;gt;&amp;gt; C|D
&amp;gt;&amp;gt; \.
=&amp;gt; SELECT * FROM alphabet;
 letter1 | letter2
---------+---------
 C       | D
 A       | B
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Concatenate the contents of the first column with a character string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT CONCAT(letter1, &amp;#39; is a letter&amp;#39;) FROM alphabet;
    CONCAT
---------------
 A is a letter
 C is a letter
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Concatenate the output of two nested CONCAT functions:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT CONCAT(CONCAT(letter1, &amp;#39; and &amp;#39;), CONCAT(letter2, &amp;#39; are both letters&amp;#39;)) FROM alphabet;
          CONCAT
--------------------------
 C and D are both letters
 A and B are both letters
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Concatenate a date and string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT current_date today;
   today
------------
 2021-12-10
(1 row)

=&amp;gt; SELECT CONCAT(&amp;#39;2021-12-31&amp;#39;::date - current_date, &amp;#39; days until end of year 2021&amp;#39;);
             CONCAT
--------------------------------
 21 days until end of year 2021
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DECODE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/decode/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/decode/</guid>
      <description>
        
        
        &lt;p&gt;Compares *&lt;code&gt;expression &lt;/code&gt;*to each search value one by one. If *&lt;code&gt;expression &lt;/code&gt;*is equal to a search, the function returns the corresponding result. If no match is found, the function returns default. If default is omitted, the function returns null.&lt;/p&gt;
&lt;p&gt;DECODE is similar to the IF-THEN-ELSE and &lt;a href=&#34;../../../../../en/sql-reference/language-elements/expressions/case-expressions/&#34;&gt;CASE&lt;/a&gt; expressions:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CASE &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;
[WHEN search THEN result]
[WHEN search THEN result]
...
[ELSE default];
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
The arguments can have any data type supported by OpenText™ Analytics Database. The result types of individual results are promoted to the least common type that can be used to represent all of them. This leads to a character string type, an exact numeric type, an approximate numeric type, or a DATETIME type, where all the various result arguments must be of the same type grouping.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DECODE ( &lt;span class=&#34;code-variable&#34;&gt;expression, search, result &lt;/span&gt;[ , &lt;span class=&#34;code-variable&#34;&gt;search, result&lt;/span&gt; ]...[, &lt;span class=&#34;code-variable&#34;&gt;default &lt;/span&gt;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The value to compare.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;search &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The value compared against &lt;em&gt;&lt;code&gt;expression.&lt;/code&gt;&lt;/em&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;result &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The value returned, if *&lt;code&gt;expression &lt;/code&gt;*is equal to search.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;default &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. If no matches are found, DECODE returns default. If default is omitted, then DECODE returns NULL (if no matches are found).&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example converts numeric values in the weight column from the product_dimension table to descriptive values in the output.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT product_description, DECODE(weight,
      2, &amp;#39;Light&amp;#39;,
     50, &amp;#39;Medium&amp;#39;,
     71, &amp;#39;Heavy&amp;#39;,
     99, &amp;#39;Call for help&amp;#39;,
         &amp;#39;N/A&amp;#39;)
  FROM product_dimension
  WHERE category_description = &amp;#39;Food&amp;#39;
  AND department_description = &amp;#39;Canned Goods&amp;#39;
  AND sku_number BETWEEN &amp;#39;SKU-#49750&amp;#39; AND &amp;#39;SKU-#49999&amp;#39;
  LIMIT 15;
        product_description        |     case
-----------------------------------+---------------
 Brand #499 canned corn            | N/A
 Brand #49900 fruit cocktail       | Medium
 Brand #49837 canned tomatoes      | Heavy
 Brand #49782 canned peaches       | N/A
 Brand #49805 chicken noodle soup  | N/A
 Brand #49944 canned chicken broth | N/A
 Brand #49819 canned chili         | N/A
 Brand #49848 baked beans          | N/A
 Brand #49989 minestrone soup      | N/A
 Brand #49778 canned peaches       | N/A
 Brand #49770 canned peaches       | N/A
 Brand #4977 fruit cocktail        | N/A
 Brand #49933 canned olives        | N/A
 Brand #49750 canned olives        | Call for help
 Brand #49777 canned tomatoes      | N/A
(15 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: EDIT_DISTANCE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/edit-distance/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/edit-distance/</guid>
      <description>
        
        
        &lt;p&gt;Calculates and returns the &lt;a href=&#34;http://en.wikipedia.org/wiki/Levenshtein_distance&#34;&gt;Levenshtein distance&lt;/a&gt; between two strings. The return value indicates the minimum number of single-character edits—insertions, deletions, or substitutions—that are required to change one string into the other. Compare to &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-distance/&#34;&gt;Jaro distance&lt;/a&gt; and &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-winkler-distance/&#34;&gt;Jaro-Winkler distance&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EDIT_DISTANCE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression1&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression1&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;string-expression2&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The two VARCHAR expressions to compare.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The Levenshtein distance between &lt;code&gt;kitten&lt;/code&gt; and &lt;code&gt;knitting&lt;/code&gt; is 3:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT EDIT_DISTANCE (&amp;#39;kitten&amp;#39;, &amp;#39;knitting&amp;#39;);
 EDIT_DISTANCE
---------------
             3
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;EDIT_DISTANCE calculates that no fewer than three changes are required to transform &lt;code&gt;kitten&lt;/code&gt; to &lt;code&gt;knitting&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;kitten&lt;/code&gt; → &lt;code&gt;knitten&lt;/code&gt; (insert &lt;code&gt;n&lt;/code&gt; after &lt;code&gt;k&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;knitten&lt;/code&gt; → &lt;code&gt;knittin&lt;/code&gt; (substitute &lt;code&gt;i&lt;/code&gt; for &lt;code&gt;e&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;knittin&lt;/code&gt; → &lt;code&gt;knitting&lt;/code&gt; (append &lt;code&gt;g&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GREATEST</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/greatest/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/greatest/</guid>
      <description>
        
        
        &lt;p&gt;Returns the largest value in a list of expressions of any data type. All data types in the list must be the same or &lt;a href=&#34;../../../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;. A NULL value in any one of the expressions returns NULL. Results can vary, depending on the locale&#39;s collation setting.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GREATEST ( { * | &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;[,...] } )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;* | &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The expressions to evaluate, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; (asterisk)&lt;/p&gt;
&lt;p&gt;Evaluates all columns in the queried table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;An expression of any data type. Functions that are included in &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; must be deterministic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;GREATEST returns 10 as the largest value in the list:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATEST(7,5,10);
 GREATEST
----------
       10
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you put quotes around the integer expressions, GREATEST compares the values as strings and returns &#39;7&#39; as the greatest value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATEST(&amp;#39;7&amp;#39;, &amp;#39;5&amp;#39;, &amp;#39;10&amp;#39;);
 GREATEST
----------
 7
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The next example returns FLOAT 1.5 as the greatest because the integer is implicitly cast to float:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATEST(1, 1.5);
 GREATEST
----------
      1.5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;GREATEST queries all columns in a view based on the VMart table &lt;code&gt;product_dimension&lt;/code&gt;, and returns the largest value in each row:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE VIEW query1 AS SELECT shelf_width, shelf_height, shelf_depth FROM product_dimension;
CREATE VIEW
=&amp;gt; SELECT shelf_width, shelf_height, shelf_depth, greatest(*) FROM query1 WHERE shelf_width = 1;
 shelf_width | shelf_height | shelf_depth | greatest
-------------+--------------+-------------+----------
           1 |            3 |           1 |        3
           1 |            3 |           3 |        3
           1 |            5 |           4 |        5
           1 |            2 |           2 |        2
           1 |            1 |           3 |        3
           1 |            2 |           2 |        2
           1 |            2 |           3 |        3
           1 |            1 |           5 |        5
           1 |            1 |           4 |        4
           1 |            5 |           3 |        5
           1 |            4 |           2 |        4
           1 |            4 |           5 |        5
           1 |            5 |           3 |        5
           1 |            2 |           5 |        5
           1 |            4 |           2 |        4
           1 |            4 |           4 |        4
           1 |            1 |           2 |        2
           1 |            4 |           3 |        4
...
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/least/#&#34;&gt;LEAST&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GREATESTB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/greatestb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/greatestb/</guid>
      <description>
        
        
        &lt;p&gt;Returns the largest value in a list of expressions of any data type, using binary ordering. All data types in the list must be the same or &lt;a href=&#34;../../../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;. A NULL value in any one of the expressions returns NULL. Results can vary, depending on the locale&#39;s collation setting.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GREATEST ( { * | &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;[,...] } )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;* | &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The expressions to evaluate, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; (asterisk)&lt;/p&gt;
&lt;p&gt;Evaluates all columns in the queried table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;An expression of any data type. Functions that are included in &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; must be deterministic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following command selects straße as the greatest in the series of inputs:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATESTB(&amp;#39;straße&amp;#39;, &amp;#39;strasse&amp;#39;);
 GREATESTB
-----------
 straße
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;GREATESTB returns 10 as the largest value in the list:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATESTB(7,5,10);
 GREATESTB
-----------
        10
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you put quotes around the integer expressions, GREATESTB compares the values as strings and returns &#39;7&#39; as the greatest value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATESTB(&amp;#39;7&amp;#39;, &amp;#39;5&amp;#39;, &amp;#39;10&amp;#39;);
 GREATESTB
-----------
 7
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The next example returns FLOAT 1.5 as the greatest because the integer is implicitly cast to float:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GREATESTB(1, 1.5);
 GREATESTB
-----------
       1.5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;GREATESTB queries all columns in a view based on the VMart table &lt;code&gt;product_dimension&lt;/code&gt;, and returns the largest value in each row:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE VIEW query1 AS SELECT shelf_width, shelf_height, shelf_depth FROM product_dimension;
CREATE VIEW
=&amp;gt; SELECT shelf_width, shelf_height, shelf_depth, greatestb(*) FROM query1 WHERE shelf_width = 1;
 shelf_width | shelf_height | shelf_depth | greatestb
-------------+--------------+-------------+-----------
           1 |            3 |           1 |         3
           1 |            3 |           3 |         3
           1 |            5 |           4 |         5
           1 |            2 |           2 |         2
           1 |            1 |           3 |         3
           1 |            2 |           2 |         2
           1 |            2 |           3 |         3
           1 |            1 |           5 |         5
           1 |            1 |           4 |         4
           1 |            5 |           3 |         5
           1 |            4 |           2 |         4
           1 |            4 |           5 |         5
           1 |            5 |           3 |         5
           1 |            2 |           5 |         5
           1 |            4 |           2 |         4
...
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/leastb/#&#34;&gt;LEASTB&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: HEX_TO_BINARY</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/hex-to-binary/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/hex-to-binary/</guid>
      <description>
        
        
        &lt;p&gt;Translates the given VARCHAR hexadecimal representation into a VARBINARY value.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;HEX_TO_BINARY ( [ 0x ] &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(BINARY or VARBINARY) String to translate.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;0x&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional prefix.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;VARBINARY HEX_TO_BINARY(VARCHAR) converts data from character type in hexadecimal format to binary type. This function is the inverse of &lt;a href=&#34;../../../../../en/sql-reference/functions/formatting-functions/to-hex/#&#34;&gt;TO_HEX&lt;/a&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;HEX_TO_BINARY(TO_HEX(x)) = x)
TO_HEX(HEX_TO_BINARY(x)) = x)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If there are an odd number of characters in the hexadecimal value, the first character is treated as the low nibble of the first (furthest to the left) byte.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;If the given string begins with &amp;quot;0x&amp;quot; the prefix is ignored. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT HEX_TO_BINARY(&amp;#39;0x6162&amp;#39;) AS hex1, HEX_TO_BINARY(&amp;#39;6162&amp;#39;) AS hex2;
 hex1 | hex2
------+------
 ab   | ab
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If an invalid hex value is given, OpenText™ Analytics Database returns an “invalid binary representation&amp;quot; error; for example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT HEX_TO_BINARY(&amp;#39;0xffgf&amp;#39;);
ERROR:  invalid hex string &amp;#34;0xffgf&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/formatting-functions/to-hex/#&#34;&gt;TO_HEX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: HEX_TO_INTEGER</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/hex-to-integer/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/hex-to-integer/</guid>
      <description>
        
        
        &lt;p&gt;Translates the given VARCHAR hexadecimal representation into an INTEGER value.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database completes this conversion as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Adds the 0x prefix if it is not specified in the input&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Casts the VARCHAR string to a NUMERIC&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Casts the NUMERIC to an INTEGER&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;HEX_TO_INTEGER ( [ 0x ] &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;VARCHAR is the string to translate.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;0x&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is the optional prefix.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;You can enter the string with or without the Ox prefix. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT HEX_TO_INTEGER (&amp;#39;0aedc&amp;#39;)
         AS hex1,HEX_TO_INTEGER (&amp;#39;aedc&amp;#39;) AS hex2;
 hex1  | hex2
-------+-------
 44764 | 44764
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you pass the function an invalid hex value, the database returns an &lt;code&gt;invalid input syntax&lt;/code&gt; error; for example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT HEX_TO_INTEGER (&amp;#39;0xffgf&amp;#39;);
ERROR 3691:  Invalid input syntax for numeric: &amp;#34;0xffgf&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/formatting-functions/to-hex/#&#34;&gt;TO_HEX&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/hex-to-binary/#&#34;&gt;HEX_TO_BINARY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INITCAP</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/initcap/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/initcap/</guid>
      <description>
        
        
        &lt;p&gt;Capitalizes first letter of each alphanumeric word and puts the rest in lowercase.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INITCAP ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(VARCHAR) is the string to format.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Depends on collation setting of the locale.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;INITCAP is restricted to 32750 octet inputs, since it is possible for the UTF-8 representation of result to double in size.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;


Expression&lt;/th&gt; 

&lt;th &gt;


Result&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAP(&#39;high speed database&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;High Speed Database&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAP(&#39;LINUX TUTORIAL&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;Linux Tutorial&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAP(&#39;abc DEF 123aVC 124Btd,lAsT&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;Abc Def 123Avc 124Btd,Last&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAP(&#39;&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAP(null);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INITCAPB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/initcapb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/initcapb/</guid>
      <description>
        
        
        &lt;p&gt;Capitalizes first letter of each alphanumeric word and puts the rest in lowercase. Multibyte characters are not converted and are skipped.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INITCAPB ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(VARCHAR) is the string to format.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Depends on collation setting of the locale.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;


&lt;strong&gt;Expression&lt;/strong&gt;&lt;/th&gt; 

&lt;th &gt;


&lt;strong&gt;Result&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(&#39;étudiant&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;éTudiant&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(&#39;high speed database&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;High Speed Database&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(&#39;LINUX TUTORIAL&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;Linux Tutorial&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(&#39;abc DEF 123aVC 124Btd,lAsT&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;Abc Def 123Avc 124Btd,Last&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(&#39;&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT INITCAPB(null);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INSERT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/insert/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/insert/</guid>
      <description>
        
        
        &lt;p&gt;Inserts a character string into a specified location in another character string.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSERT( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string1&lt;/span&gt;&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;, n, m, &#39;string2&#39;&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string1&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(VARCHAR) Is the string in which to insert the new string.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;n&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;A character of type INTEGER that represents the starting point for the insertion within*&lt;code&gt; string1&lt;/code&gt;*. You specify the number of characters from the first character in string1 as the starting point for the insertion. For example, to insert characters before &amp;quot;c&amp;quot;, in the string &amp;quot;abcdef,&amp;quot; enter 3.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;m&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;A character of type INTEGER that represents the number of characters in*&lt;code&gt;string1&lt;/code&gt;&lt;em&gt;(if any)&lt;/em&gt;&lt;code&gt; &lt;/code&gt;*that should be replaced by the insertion. For example,if you want the insertion to replace the letters &amp;quot;cd&amp;quot; in the string &amp;quot;abcdef, &amp;quot; enter 2.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string2&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(VARCHAR) Is the string to be inserted.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example changes the string Warehouse to Storehouse using the INSERT function:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSERT (&amp;#39;Warehouse&amp;#39;,1,3,&amp;#39;Stor&amp;#39;);
   INSERT
------------
 Storehouse
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INSTR</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/instr/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/instr/</guid>
      <description>
        
        
        &lt;p&gt;Searches *&lt;code&gt;string &lt;/code&gt;*for *&lt;code&gt;substring &lt;/code&gt;*and returns an integer indicating the position of the character in *&lt;code&gt;string &lt;/code&gt;*that is the first character of this &lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt;. The return value is based on the character position of the identified character.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSTR ( &lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;,&lt;span class=&#34;code-variable&#34;&gt; substring&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;occurrence &lt;/span&gt;] ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR, or BINARY or VARBINARY) Text expression to search.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;substring &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR, or BINARY or VARBINARY) String to search for.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Nonzero integer indicating the character of string where OpenText™ Analytics Database begins the search. If position is negative, then the database counts backward from the end of string and then searches backward from the resulting position. The first character of string occupies the default position 1, and position cannot be 0.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;occurrence &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Integer indicating which occurrence of string database searches. The value of occurrence must be positive (greater than 0), and the default is 1.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Both &lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt; must be of types that can resolve to an integer. The default values of both parameters are 1, meaning the database begins searching at the first character of string for the first occurrence of substring. The return value is relative to the beginning of string, regardless of the value of position, and is expressed in characters.&lt;/p&gt;
&lt;p&gt;If the search is unsuccessful (that is, if substring does not appear *&lt;code&gt;occurrence &lt;/code&gt;*times after the &lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt; character of &lt;em&gt;&lt;code&gt;string,&lt;/code&gt;&lt;/em&gt; the return value is 0.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The first example searches forward in string ‘abc’ for substring ‘b’. The search returns the position in ‘abc’ where ‘b’ occurs, or position 2. Because no position parameters are given, the default search starts at ‘a’, position 1.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(&amp;#39;abc&amp;#39;, &amp;#39;b&amp;#39;);
 INSTR
-------
     2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following three examples use character position to search backward to find the position of a substring.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Although it might seem intuitive that the function returns a negative integer, the position of &lt;em&gt;&lt;code&gt;n&lt;/code&gt;&lt;/em&gt; occurrence is read left to right in the string, even though the search happens in reverse (from the end—or right side—of the string).

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;In the first example, the function counts backward one character from the end of the string, starting with character ‘c’. The function then searches backward for the first occurrence of ‘a’, which it finds it in the first position in the search string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(&amp;#39;abc&amp;#39;, &amp;#39;a&amp;#39;, -1);
 INSTR
-------
     1
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
In the second example, the function counts backward one byte from the end of the string, starting with character ‘c’. The function then searches backward for the first occurrence of ‘a’, which it finds it in the first position in the search string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(VARBINARY &amp;#39;abc&amp;#39;, VARBINARY &amp;#39;a&amp;#39;, -1);
 INSTR
-------
     1
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the third example, the function counts backward one character from the end of the string, starting with character ‘b’, and searches backward for substring ‘bc’, which it finds in the second position of the search string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(&amp;#39;abcb&amp;#39;, &amp;#39;bc&amp;#39;, -1);
 INSTR
-------
     2
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the fourth example, the function counts backward one character from the end of the string, starting with character ‘b’, and searches backward for substring ‘bcef’, which it does not find. The result is 0.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(&amp;#39;abcb&amp;#39;, &amp;#39;bcef&amp;#39;, -1);
INSTR
-------
     0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;
In the fifth example, the function counts backward one byte from the end of the string, starting with character ‘b’, and searches backward for substring ‘bcef’, which it does not find. The result is 0.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(VARBINARY &amp;#39;abcb&amp;#39;, VARBINARY &amp;#39;bcef&amp;#39;, -1);
INSTR
-------
     0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Multibyte characters are treated as a single character:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTR(&amp;#39;aébc&amp;#39;, &amp;#39;b&amp;#39;);
 INSTR
-------
     3
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Use INSTRB to treat multibyte characters as binary:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTRB(&amp;#39;aébc&amp;#39;, &amp;#39;b&amp;#39;);
  INSTRB
--------
      4
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: INSTRB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/instrb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/instrb/</guid>
      <description>
        
        
        &lt;p&gt;Searches &lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt; for &lt;em&gt;&lt;code&gt;substring&lt;/code&gt;&lt;/em&gt; and returns an integer indicating the octet position within string that is the first &lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt;. The return value is based on the octet position of the identified byte.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSTRB ( &lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;,&lt;span class=&#34;code-variable&#34;&gt; substring&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;occurrence &lt;/span&gt;] ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is the text expression to search.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;substring &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is the string to search for.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is a nonzero integer indicating the character of string where OpenText™ Analytics Database begins the search. If position is negative, the database counts backward from the end of string and then searches backward from the resulting position. The first byte of string occupies the default position 1, and position cannot be 0.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;occurrence &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is an integer indicating which occurrence of string database searches. The value of occurrence must be positive (greater than 0), and the default is 1.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;Both &lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt; must be of types that can resolve to an integer. The default values of both parameters are 1, meaning the database begins searching at the first byte of string for the first occurrence of substring. The return value is relative to the beginning of string, regardless of the value of position, and is expressed in octets.&lt;/p&gt;
&lt;p&gt;If the search is unsuccessful (that is, if substring does not appear *&lt;code&gt;occurrence &lt;/code&gt;*times after the *&lt;code&gt;position &lt;/code&gt;*character of *&lt;code&gt;string, &lt;/code&gt;*then the return value is 0.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT INSTRB(&amp;#39;straße&amp;#39;, &amp;#39;ß&amp;#39;);
 INSTRB
--------
      5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/instr/#&#34;&gt;INSTR&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: ISUTF8</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/isutf8/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/isutf8/</guid>
      <description>
        
        
        &lt;p&gt;Tests whether a string is a valid UTF-8 string. Returns true if the string conforms to UTF-8 standards, and false otherwise. This function is useful to test strings for UTF-8 compliance before passing them to one of the regular expression functions, such as &lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-like/#&#34;&gt;REGEXP_LIKE&lt;/a&gt;, which expect UTF-8 characters by default.&lt;/p&gt;
&lt;p&gt;ISUTF8 checks for invalid UTF8 byte sequences, according to UTF-8 rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;invalid bytes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;an unexpected continuation byte&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;a start byte not followed by enough continuation bytes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;an Overload Encoding&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The presence of an invalid UTF-8 byte sequence results in a return value of false.&lt;/p&gt;
&lt;p&gt;To coerce a string to UTF-8, use &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/makeutf8/#&#34;&gt;MAKEUTF8&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ISUTF8( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; );
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The string to test for UTF-8 compliance.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT ISUTF8(E&amp;#39;\xC2\xBF&amp;#39;); -- UTF-8 INVERTED QUESTION MARK ISUTF8
--------
 t
(1 row)

=&amp;gt; SELECT ISUTF8(E&amp;#39;\xC2\xC0&amp;#39;); -- UNDEFINED UTF-8 CHARACTER
 ISUTF8
--------
 f
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: JARO_DISTANCE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-distance/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-distance/</guid>
      <description>
        
        
        &lt;p&gt;Calculates and returns the &lt;a href=&#34;https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance#Jaro_similarity&#34;&gt;Jaro similarity&lt;/a&gt;, an edit distance between two sequences. It is useful for queries designed for short strings, such as finding similar names. Also see &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-winkler-distance/&#34;&gt;Jaro-Winkler distance&lt;/a&gt;, which adds a prefix scale favoring strings that match in the beginning, and &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/edit-distance/&#34;&gt;edit distance&lt;/a&gt;, which returns the Levenshtein distance between two strings.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;JARO_DISTANCE (&lt;span class=&#34;code-variable&#34;&gt;string-expression1&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string-expression1&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2 &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The two VARCHAR expressions to compare. Neither can be NULL.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;Return only the names with a Jaro distance from &#39;rode&#39; that is greater than 0.6:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT name FROM names WHERE JARO_DISTANCE(&amp;#39;rode&amp;#39;, name) &amp;gt; 0.6;
name
---------
fred
frieda
rodgers
rogers
(4 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: JARO_WINKLER_DISTANCE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-winkler-distance/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-winkler-distance/</guid>
      <description>
        
        
        &lt;p&gt;Calculates and returns the &lt;a href=&#34;https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance#Jaro%E2%80%93Winkler_similarity&#34;&gt;Jaro-Winkler similarity&lt;/a&gt;, an edit distance between two sequences. It is useful for queries designed for short strings, such as finding similar names. It is a variant of the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/jaro-distance/&#34;&gt;Jaro distance&lt;/a&gt; metric, to which it adds a prefix scale giving more favorable ratings for strings that match from the beginning. See also &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/edit-distance/&#34;&gt;edit distance&lt;/a&gt;, which returns the Levenshtein distance between two strings.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;JARO_WINKLER_DISTANCE (&lt;span class=&#34;code-variable&#34;&gt;string-expression1 &lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2&lt;/span&gt; [ USING PARAMETERS prefix_scale=&lt;span class=&#34;code-variable&#34;&gt;scale&lt;/span&gt;, prefix_length=&lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt;])
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string-expression1&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;string-expression2 &lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The two VARCHAR expressions to compare. Neither can be NULL.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;scale&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;A FLOAT specifying the scale value by which to weight the importance of matching prefixes. Optional.
&lt;p&gt;default = 0.1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;An non-negative INT representing the maximum matching prefix length. Optional.
&lt;p&gt;default = 4&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Return only the names with a Jaro-Winkler distance from &#39;rode&#39; that is greater than 0.6:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT name FROM names WHERE JARO_WINKLER_DISTANCE(&amp;#39;rode&amp;#39;, name) &amp;gt; 0.6;
name
---------
fred
frieda
rodgers
rogers
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The Jaro-Winkler distance between &#39;help&#39; and &#39;hello&#39; given a &lt;code&gt;prefix_scale&lt;/code&gt; of 0.1 and &lt;code&gt;prefix_length&lt;/code&gt; of 0 is 0.783333333333333:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; select JARO_WINKLER_DISTANCE(&amp;#39;help&amp;#39;, &amp;#39;hello&amp;#39; USING PARAMETERS prefix_scale=0.1, prefix_length=0);
jaro_winkler_distance
-----------------------
0.783333333333333
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LEAST</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/least/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/least/</guid>
      <description>
        
        
        &lt;p&gt;Returns the smallest value in a list of expressions of any data type. All data types in the list must be the same or &lt;a href=&#34;../../../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;. A NULL value in any one of the expressions returns NULL. Results can vary, depending on the locale&#39;s collation setting.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LEAST ( { * | &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;[,...] } )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;* | &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The expressions to evaluate, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; (asterisk)&lt;/p&gt;
&lt;p&gt;Evaluates all columns in the queried table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;An expression of any data type. Functions that are included in &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; must be deterministic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;LEASTB returns 5 as the smallest value in the list:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEASTB(7, 5, 10);
 LEASTB
--------
      5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you put quotes around the integer expressions, LEASTB compares the values as strings and returns &#39;10&#39; as the smallest value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEASTB(&amp;#39;7&amp;#39;, &amp;#39;5&amp;#39;, &amp;#39;10&amp;#39;);
 LEASTB
--------
 10
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;LEAST returns 1.5, as INTEGER 2 is implicitly cast to FLOAT:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEAST(2, 1.5);
 LEAST
-------
   1.5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;LEAST queries all columns in a view based on the VMart table &lt;code&gt;product_dimension&lt;/code&gt;, and returns the smallest value in each row:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE VIEW query1 AS SELECT shelf_width, shelf_height, shelf_depth FROM product_dimension;
CREATE VIEW
=&amp;gt; SELECT shelf_height, shelf_width, shelf_depth, least(*) FROM query1 WHERE shelf_height = 5;
 shelf_height | shelf_width | shelf_depth | least
--------------+-------------+-------------+-------
            5 |           3 |           4 |     3
            5 |           4 |           3 |     3
            5 |           1 |           4 |     1
            5 |           4 |           1 |     1
            5 |           2 |           4 |     2
            5 |           2 |           3 |     2
            5 |           1 |           3 |     1
            5 |           1 |           3 |     1
            5 |           5 |           1 |     1
            5 |           2 |           4 |     2
            5 |           4 |           5 |     4
            5 |           2 |           4 |     2
            5 |           4 |           4 |     4
            5 |           3 |           4 |     3
...
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/greatest/#&#34;&gt;GREATEST&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LEASTB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/leastb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/leastb/</guid>
      <description>
        
        
        &lt;p&gt;Returns the smallest value in a list of expressions of any data type, using binary ordering. All data types in the list must be the same or &lt;a href=&#34;../../../../../en/sql-reference/data-types/data-type-coercion-chart/&#34;&gt;compatible&lt;/a&gt;. A NULL value in any one of the expressions returns NULL. Results can vary, depending on the locale&#39;s collation setting.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LEASTB ( { * | &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;[,...] } )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;* | &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The expressions to evaluate, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; (asterisk)&lt;/p&gt;
&lt;p&gt;Evaluates all columns in the queried table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;An expression of any data type. Functions that are included in &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; must be deterministic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following command selects &lt;code&gt;strasse&lt;/code&gt; as the smallest value in the list:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEASTB(&amp;#39;straße&amp;#39;, &amp;#39;strasse&amp;#39;);
 LEASTB
---------
 strasse
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;LEASTB returns 5 as the smallest value in the list:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEAST(7, 5, 10);
 LEAST
-------
     5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you put quotes around the integer expressions, LEAST compares the values as strings and returns &#39;10&#39; as the smallest value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEASTB(&amp;#39;7&amp;#39;, &amp;#39;5&amp;#39;, &amp;#39;10&amp;#39;);
 LEAST
-------
 10
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The next example returns 1.5, as INTEGER 2 is implicitly cast to FLOAT:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEASTB(2, 1.5);
 LEASTB
--------
    1.5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;LEASTB queries all columns in a view based on the VMart table &lt;code&gt;product_dimension&lt;/code&gt;, and returns the smallest value in each row:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE VIEW query1 AS SELECT shelf_width, shelf_height, shelf_depth FROM product_dimension;
CREATE VIEW
=&amp;gt; SELECT shelf_height, shelf_width, shelf_depth, leastb(*) FROM query1 WHERE shelf_height = 5;
 shelf_height | shelf_width | shelf_depth | leastb
--------------+-------------+-------------+--------
            5 |           3 |           4 |      3
            5 |           4 |           3 |      3
            5 |           1 |           4 |      1
            5 |           4 |           1 |      1
            5 |           2 |           4 |      2
            5 |           2 |           3 |      2
            5 |           1 |           3 |      1
            5 |           1 |           3 |      1
            5 |           5 |           1 |      1
            5 |           2 |           4 |      2
            5 |           4 |           5 |      4
            5 |           2 |           4 |      2
            5 |           4 |           4 |      4
            5 |           3 |           4 |      3
            5 |           5 |           4 |      4
            5 |           5 |           1 |      1
            5 |           3 |           1 |      1
...
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/greatestb/#&#34;&gt;GREATESTB&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LEFT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/left/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/left/</guid>
      <description>
        
        
        &lt;p&gt;Returns the specified characters from the left side of a string.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LEFT ( &lt;span class=&#34;code-variable&#34;&gt;string-expr&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expr&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string expression to return.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;length&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;An integer value that specifies how many characters to return.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LEFT(&amp;#39;vertica&amp;#39;, 3);
 LEFT
------
 ver
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; SELECT DISTINCT(
   LEFT (customer_name, 4)) FnameTruncated
   FROM customer_dimension ORDER BY FnameTruncated LIMIT 10;
 FnameTruncated
----------------
 Alex
 Amer
 Amy
 Anna
 Barb
 Ben
 Bett
 Bria
 Carl
 Crai
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/substr/#&#34;&gt;SUBSTR&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LENGTH</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/length/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/length/</guid>
      <description>
        
        
        &lt;p&gt;Returns the length of a string. The behavior of &lt;code&gt;LENGTH&lt;/code&gt; varies according to the input data type:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;CHAR and VARCHAR: Identical to 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/character-length/#&#34;&gt;CHARACTER_LENGTH&lt;/a&gt;&lt;/code&gt;, returns the string length in UTF-8 characters, .&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CHAR: Strips padding.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;BINARY and VARBINARY: Identical to 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/octet-length/#&#34;&gt;OCTET_LENGTH&lt;/a&gt;&lt;/code&gt;, returns the string length in bytes (octets).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LENGTH ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;String to evaluate, one of the following: CHAR, VARCHAR, BINARY or VARBINARY.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Statement&lt;/th&gt; 

&lt;th &gt;
Returns&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT LENGTH(&#39;1234  &#39;::CHAR(10));&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT LENGTH(&#39;1234  &#39;::VARCHAR(10));&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT LENGTH(&#39;1234  &#39;::BINARY(10));&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;10&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT LENGTH(&#39;1234  &#39;::VARBINARY(10));&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT LENGTH(NULL::CHAR(10)) IS NULL;&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;t&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/bit-length/#&#34;&gt;BIT_LENGTH&lt;/a&gt;&lt;/code&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LOWER</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/lower/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/lower/</guid>
      <description>
        
        
        &lt;p&gt;Takes a string value and returns a VARCHAR value converted to lowercase.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;stable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LOWER ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;CHAR or VARCHAR string to convert, where the string width is ≤ 65000 octets.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;In practice, &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; should not exceed 32,500 octets. LOWER does not use the locale&#39;s collation setting—for example, &lt;code&gt;collation=binary&lt;/code&gt;—to identify its encoding; rather, it treats the input argument as a UTF-8 encoded string. The UTF-8 representation of the input value might be double its original width. As a result, LOWER returns an error if the input value exceeds 32,500 octets.&lt;/p&gt;
&lt;p&gt;Note also that if &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; is a table column, LOWER calculates its size from the column&#39;s defined width, and not from the column data. If the column width is greater than VARCHAR(32500), OpenText™ Analytics Database returns an error.&lt;/p&gt;

&lt;/div&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LOWER(&amp;#39;AbCdEfG&amp;#39;);
  LOWER
---------
 abcdefg
(1 row)

=&amp;gt; SELECT LOWER(&amp;#39;The Bat In The Hat&amp;#39;);
       LOWER
--------------------
 the bat in the hat
(1 row)

=&amp;gt; SELECT LOWER(&amp;#39;ÉTUDIANT&amp;#39;);
  LOWER
----------
 étudiant
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LOWERB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/lowerb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/lowerb/</guid>
      <description>
        
        
        &lt;p&gt;Returns a character string with each ASCII character converted to lowercase. Multi-byte characters are skipped and not converted.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LOWERB ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;CHAR or VARCHAR string to convert&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In the following example, the multi-byte UTF-8 character É is not converted to lowercase:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LOWERB(&amp;#39;ÉTUDIANT&amp;#39;);
  LOWERB
----------
 Étudiant
(1 row)

=&amp;gt; SELECT LOWER(&amp;#39;ÉTUDIANT&amp;#39;);
  LOWER
----------
 étudiant
(1 row)

=&amp;gt; SELECT LOWERB(&amp;#39;AbCdEfG&amp;#39;);
 LOWERB
---------
 abcdefg
(1 row)

=&amp;gt; SELECT LOWERB(&amp;#39;The OpenText&amp;amp;trade; Analytics Database&amp;#39;);
        LOWERB
----------------------
 the OpenText&amp;amp;trade; Analytics Database
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LPAD</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/lpad/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/lpad/</guid>
      <description>
        
        
        &lt;p&gt;Returns a VARCHAR value representing a string of a specific length filled on the left with specific characters.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LPAD ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt; [ , &lt;span class=&#34;code-variable&#34;&gt;fill&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR OR VARCHAR) specifies the string to fill&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(INTEGER) specifies the number of characters to return&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;fill&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR OR VARCHAR) specifies the repeating string of characters with which to fill the output string. The default is the space character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LPAD(&amp;#39;database&amp;#39;, 15, &amp;#39;xzy&amp;#39;);
      LPAD
-----------------
 xzyxzyxdatabase
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the string is already longer than the specified length it is truncated on the right:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LPAD(&amp;#39;establishment&amp;#39;, 10, &amp;#39;abc&amp;#39;);
    LPAD
------------
 establishm
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: LTRIM</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/ltrim/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/ltrim/</guid>
      <description>
        
        
        &lt;p&gt;Returns a VARCHAR value representing a string with leading blanks removed from the left side (beginning).&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LTRIM ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; [ , &lt;span class=&#34;code-variable&#34;&gt;characters&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string to trim&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;characters&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) specifies the characters to remove from the left side of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;. The default is the space character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT LTRIM(&amp;#39;zzzyyyyyyxxxxxxxxtrim&amp;#39;, &amp;#39;xyz&amp;#39;);
 LTRIM
-------
 trim
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/btrim/#&#34;&gt;BTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/rtrim/#&#34;&gt;RTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/trim/#&#34;&gt;TRIM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MAKEUTF8</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/makeutf8/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/makeutf8/</guid>
      <description>
        
        
        &lt;p&gt;Coerces a string to UTF-8 by removing or replacing non-UTF-8 characters.&lt;/p&gt;
&lt;p&gt;MAKEUTF8 flags invalid UTF-8 characters byte by byte. For example, the byte sequence &lt;code&gt;0xE0 0x7F 0x80&lt;/code&gt; is an invalid three-byte UTF-8 sequence, but the middle byte, &lt;code&gt;0x7F&lt;/code&gt;, is a valid one-byte UTF-8 character. In this example, &lt;code&gt;0x7F&lt;/code&gt; is preserved and the other two bytes are removed or replaced.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MAKEUTF8( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt; [USING PARAMETERS &lt;span class=&#34;code-variable&#34;&gt;param=value&lt;/span&gt;] );
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string expression to evaluate for non-UTF-8 characters&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;replacement_string&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the VARCHAR(16) string that MAKEUTF8 uses to replace each non-UTF-8 character that it finds in &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. If this parameter is omitted, non-UTF-8 characters are removed. For example, the following SQL specifies to replace all non-UTF characters in the &lt;code&gt;name&lt;/code&gt; column with the string &lt;code&gt;^&lt;/code&gt;:&lt;br /&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MAKEUTF8(name USING PARAMETERS replacement_string=&amp;#39;^&amp;#39;) FROM people;
&lt;/code&gt;&lt;/pre&gt;&lt;/dd&gt;
&lt;/dl&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MD5</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/md5/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/md5/</guid>
      <description>
        
        
        &lt;p&gt;Calculates the MD5 hash of string, returning the result as a VARCHAR string in hexadecimal.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MD5 ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Is the argument string.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MD5(&amp;#39;123&amp;#39;);
               MD5
----------------------------------
 202cb962ac59075b964b07152d234b70
(1 row)

=&amp;gt; SELECT MD5(&amp;#39;Vertica&amp;#39;::bytea);
               MD5
----------------------------------
 fc45b815747d8236f9f6fdb9c2c3f676
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/&#34;&gt;SHA1&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/&#34;&gt;SHA224&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/&#34;&gt;SHA256&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/&#34;&gt;SHA384&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha512/&#34;&gt;SHA512&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: OCTET_LENGTH</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/octet-length/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/octet-length/</guid>
      <description>
        
        
        &lt;p&gt;Takes one argument as an input and returns the string length in octets for all string types.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;OCTET_LENGTH ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR or BINARY or VARBINARY) is the string to measure.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the data type of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; is a CHAR, VARCHAR or VARBINARY, the result is the same as the actual length of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; in octets. For CHAR, the length does not include any trailing spaces.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the data type of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; is BINARY, the result is the same as the fixed-length of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the value of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; is NULL, the result is NULL.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;


&lt;strong&gt;Expression&lt;/strong&gt;&lt;/th&gt; 

&lt;th &gt;


&lt;strong&gt;Result&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(CHAR(10) &#39;1234  &#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(CHAR(10) &#39;1234&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(CHAR(10) &#39;  1234&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARCHAR(10) &#39;1234  &#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARCHAR(10) &#39;1234 &#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARCHAR(10) &#39;1234&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARCHAR(10) &#39;  1234&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(&#39;abc&#39;::VARBINARY);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARBINARY &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARBINARY &#39;abc  &#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(BINARY(6) &#39;abc&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(VARBINARY &#39;&#39;);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(&#39;&#39;::BINARY);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;


&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(null::VARBINARY);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;


&lt;code&gt;SELECT OCTET_LENGTH(null::BINARY);&lt;/code&gt;&lt;/td&gt; 

&lt;td &gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/bit-length/#&#34;&gt;BIT_LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/character-length/#&#34;&gt;CHARACTER_LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/length/#&#34;&gt;LENGTH&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: OVERLAY</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/overlay/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/overlay/</guid>
      <description>
        
        
        &lt;p&gt;Replaces part of a string with another string and returns the new string value as a VARCHAR.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;p&gt;&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt; if using OCTETS, &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/stable-functions/&#34; title=&#34;See also Immutable (invariant) functions.&#34;&gt;Stable&lt;/a&gt; otherwise&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;OVERLAY ( &lt;span class=&#34;code-variable&#34;&gt;input-string&lt;/span&gt; PLACING &lt;span class=&#34;code-variable&#34;&gt;replace-string&lt;/span&gt; FROM &lt;span class=&#34;code-variable&#34;&gt;position&lt;/span&gt; [ FOR &lt;span class=&#34;code-variable&#34;&gt;extent&lt;/span&gt; ] [ USING { CHARACTERS | OCTETS } ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to process, of type CHAR or VARCHAR.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to replace the specified substring of &lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt;, of type CHAR or VARCHAR.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Integer ≥1 that specifies the first character or octet of &lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt; to overlay &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;extent&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Integer that specifies how many characters or octets of &lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt; to overlay with &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;. If omitted, OVERLAY uses the length of &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;.
&lt;p&gt;For example, compare the following calls to OVERLAY:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;OVERLAY omits &lt;code&gt;FOR&lt;/code&gt; clause. The number of characters replaced in the input string equals the number of characters in replacement string &lt;code&gt;ABC&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
dbadmin=&amp;gt; SELECT OVERLAY (&amp;#39;123456789&amp;#39; PLACING &amp;#39;ABC&amp;#39; FROM 5);
  overlay
-----------
 1234ABC89
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OVERLAY includes a &lt;code&gt;FOR&lt;/code&gt; clause that specifies to replace four characters in the input string with the replacement string. The replacement string is three characters long, so OVERLAY returns a string that is one character shorter than the input string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT OVERLAY (&amp;#39;123456789&amp;#39; PLACING &amp;#39;ABC&amp;#39; FROM 5 FOR 4);
 overlay
----------
 1234ABC9
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OVERLAY includes a &lt;code&gt;FOR&lt;/code&gt; clause that specifies to replace -2 characters in the input string with the replacement string. The function returns a string that is two characters longer than the input string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT OVERLAY (&amp;#39;123456789&amp;#39; PLACING &amp;#39;ABC&amp;#39; FROM 5 FOR -2);
    overlay
----------------
 1234ABC3456789
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;USING CHARACTERS | OCTETS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies whether OVERLAY uses characters (default) or octets.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If you specify &lt;code&gt;USING OCTETS&lt;/code&gt;, OpenText™ Analytics Database calls the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/overlayb/#&#34;&gt;OVERLAYB&lt;/a&gt; function.

&lt;/div&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT OVERLAY(&amp;#39;123456789&amp;#39; PLACING &amp;#39;xxx&amp;#39; FROM 2);
  overlay
-----------
 1xxx56789
(1 row)

=&amp;gt; SELECT OVERLAY(&amp;#39;123456789&amp;#39; PLACING &amp;#39;XXX&amp;#39; FROM 2 USING OCTETS);
 overlayb
-----------
 1XXX56789
(1 row)

=&amp;gt; SELECT OVERLAY(&amp;#39;123456789&amp;#39; PLACING &amp;#39;xxx&amp;#39; FROM 2 FOR 4);
 overlay
----------
 1xxx6789
(1 row)

=&amp;gt; SELECT OVERLAY(&amp;#39;123456789&amp;#39; PLACING &amp;#39;xxx&amp;#39; FROM 2 FOR 5);
 overlay
---------
 1xxx789
(1 row)

=&amp;gt; SELECT OVERLAY(&amp;#39;123456789&amp;#39; PLACING &amp;#39;xxx&amp;#39; FROM 2 FOR 6);
 overlay
---------
 1xxx89
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: OVERLAYB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/overlayb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/overlayb/</guid>
      <description>
        
        
        &lt;p&gt;Replaces part of a string with another string and returns the new string as an octet value.&lt;/p&gt;
&lt;p&gt;The OVERLAYB function treats the multibyte character string as a string of octets (bytes) and use octet numbers as incoming and outgoing position specifiers and lengths. The strings themselves are type VARCHAR, but they treated as if each byte was a separate character.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;OVERLAYB ( &lt;span class=&#34;code-variable&#34;&gt;input-string&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;replace-string&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;extent&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to process, of type CHAR or VARCHAR.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to replace the specified substring of &lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt;, of type CHAR or VARCHAR.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Integer ≥1 that specifies the first octet of*&lt;code&gt;input-string&lt;/code&gt;* to overlay &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;extent&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Integer that specifies how many octets of &lt;em&gt;&lt;code&gt;input-string&lt;/code&gt;&lt;/em&gt; to overlay with &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;. If omitted, OVERLAY uses the length of &lt;em&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;ééé&amp;#39;, 2);
 OVERLAYB
----------
 1ééé89
(1 row)
=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;ßßß&amp;#39;, 2);
 OVERLAYB
----------
 1ßßß89
(1 row)
=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;xxx&amp;#39;, 2);
 OVERLAYB
-----------
 1xxx56789
(1 row)
=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;xxx&amp;#39;, 2, 4);
 OVERLAYB
----------
 1xxx6789
(1 row)
=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;xxx&amp;#39;, 2, 5);
 OVERLAYB
----------
 1xxx789
(1 row)
=&amp;gt; SELECT OVERLAYB(&amp;#39;123456789&amp;#39;, &amp;#39;xxx&amp;#39;, 2, 6);
 OVERLAYB
----------
 1xxx89
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: POSITION</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/position/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/position/</guid>
      <description>
        
        
        &lt;p&gt;Returns an INTEGER value representing the character location of a specified substring with a string (counting from one).&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax-1&#34;&gt;Syntax 1&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;POSITION ( &lt;span class=&#34;code-variable&#34;&gt;substring&lt;/span&gt; IN &lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;[ USING { CHARACTERS | OCTETS } ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;substring&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the substring to locate&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string in which to locate the substring&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;USING CHARACTERS | OCTETS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Determines whether the position is reported by using characters (the default) or octets.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;syntax-2&#34;&gt;Syntax 2&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;POSITION ( &lt;span class=&#34;code-variable&#34;&gt;substring&lt;/span&gt; IN &lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments-1&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;substring&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;(VARBINARY) is the substring to locate&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;(VARBINARY) is the string in which to locate the substring&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When the string and substring are CHAR or VARCHAR, the return value is based on either the character or octet position of the substring.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the string and substring are VARBINARY, the return value is always based on the octet position of the substring.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The string and substring must be consistent. Do not mix VARBINARY with CHAR or VARCHAR.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;POSITION is similar to&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/strpos/&#34;&gt; STRPOS&lt;/a&gt; although POSITION allows finding by characters and by octet.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the string is not found, the return value is zero.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT POSITION(&amp;#39;é&amp;#39; IN &amp;#39;étudiant&amp;#39; USING CHARACTERS);
 position
----------
        1
(1 row)
=&amp;gt; SELECT POSITION(&amp;#39;ß&amp;#39; IN &amp;#39;straße&amp;#39; USING OCTETS);
 positionb
-----------
         5
(1 row)

=&amp;gt; SELECT POSITION(&amp;#39;c&amp;#39; IN &amp;#39;abcd&amp;#39; USING CHARACTERS);
 position
----------
        3
(1 row)

=&amp;gt; SELECT POSITION(VARBINARY &amp;#39;456&amp;#39; IN VARBINARY &amp;#39;123456789&amp;#39;);
 position
----------
        4
(1 row)

SELECT POSITION(&amp;#39;n&amp;#39; in &amp;#39;León&amp;#39;) as &amp;#39;default&amp;#39;,
       POSITIONB(&amp;#39;León&amp;#39;, &amp;#39;n&amp;#39;) as &amp;#39;POSITIONB&amp;#39;,
       POSITION(&amp;#39;n&amp;#39; in &amp;#39;León&amp;#39; USING CHARACTERS) as &amp;#39;pos_chars&amp;#39;,
       POSITION(&amp;#39;n&amp;#39; in &amp;#39;León&amp;#39; USING OCTETS) as &amp;#39;pos_oct&amp;#39;,INSTR(&amp;#39;León&amp;#39;,&amp;#39;n&amp;#39;),
       INSTRB(&amp;#39;León&amp;#39;,&amp;#39;n&amp;#39;), REGEXP_INSTR(&amp;#39;León&amp;#39;,&amp;#39;n&amp;#39;);
 default | POSITIONB | pos_chars | pos_oct | INSTR | INSTRB | REGEXP_INSTR
---------+-----------+-----------+---------+-------+--------+--------------
       4 |         5 |         4 |       5 |     4 |      5 |            4
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: POSITIONB</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/positionb/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/positionb/</guid>
      <description>
        
        
        &lt;p&gt;Returns an INTEGER value representing the octet location of a specified substring with a string (counting from one).&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;POSITIONB ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;substring &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string in which to locate the substring&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;substring&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the substring to locate&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT POSITIONB(&amp;#39;straße&amp;#39;, &amp;#39;ße&amp;#39;);
 POSITIONB
-----------
         5
(1 row)


=&amp;gt; SELECT POSITIONB(&amp;#39;étudiant&amp;#39;, &amp;#39;é&amp;#39;);
 POSITIONB
-----------
         1
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: QUOTE_IDENT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-ident/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-ident/</guid>
      <description>
        
        
        &lt;p&gt;Returns the specified string argument in the format required to use the string as an &lt;a href=&#34;../../../../../en/sql-reference/language-elements/identifiers/&#34;&gt;identifier&lt;/a&gt; in an SQL statement. Quotes are added as needed—for example, if the string contains non-identifier characters or is an SQL or &lt;a href=&#34;../../../../../en/sql-reference/language-elements/keywords/&#34;&gt;OpenText™ Analytics Database-reserved&lt;/a&gt; keyword:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;1time&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Next week&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;SELECT&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Embedded double quotes are doubled.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;SQL identifiers such as table and column names are stored as created, and references to them are resolved using case-insensitive compares. Thus, you do not need to double-quote mixed-case identifiers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OpenText™ Analytics Database quotes all reserved keywords, even if unused.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;QUOTE_IDENT( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;String to quote&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Quoted identifiers are case-insensitive and the database does not supply the quotes:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT QUOTE_IDENT(&amp;#39;VErtIcA&amp;#39;);
 QUOTE_IDENT
-------------
 VErtIcA
(1 row)

=&amp;gt; SELECT QUOTE_IDENT(&amp;#39;Vertica database&amp;#39;);
    QUOTE_IDENT
--------------------
 &amp;#34;Vertica database&amp;#34;
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Embedded double quotes are doubled:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT QUOTE_IDENT(&amp;#39;Vertica &amp;#34;!&amp;#34; database&amp;#39;);
       QUOTE_IDENT
--------------------------
 &amp;#34;Vertica &amp;#34;&amp;#34;!&amp;#34;&amp;#34; database&amp;#34;
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example uses the SQL keyword SELECT, so results are double quoted:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT QUOTE_IDENT(&amp;#39;select&amp;#39;);
 QUOTE_IDENT
-------------
 &amp;#34;select&amp;#34;
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/quote-literal/#&#34;&gt;QUOTE_LITERAL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/quote-nullable/#&#34;&gt;QUOTE_NULLABLE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: QUOTE_LITERAL</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-literal/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-literal/</guid>
      <description>
        
        
        &lt;p&gt;Returns the given string suitably quoted for use as a string literal in a SQL statement string. Embedded single quotes and backslashes are doubled. As per the SQL standard, the function recognizes two 	consecutive single quotes within a string literal as a single quote character.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;QUOTE_LITERAL ( &lt;span class=&#34;code-variable&#34;&gt;string &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Argument that resolves to one or more strings to format as string literals.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In the following example, the first query returns no first name for Cher or Sting; the second query uses QUOTE_LITERAL, which sets off string values with single quotes, including empty strings. In this case, &lt;code&gt;fname&lt;/code&gt; for Sting is set to an empty string (&lt;code&gt;&#39;&#39;&lt;/code&gt;), while &lt;code&gt;fname&lt;/code&gt; for Cher is empty, indicating that it is set to null value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM lead_vocalists ORDER BY lname ASC;
 fname  |  lname  |                      band
--------+---------+-------------------------------------------------
        | Cher    | [&amp;#34;Sonny and Cher&amp;#34;]
 Mick   | Jagger  | [&amp;#34;Rolling Stones&amp;#34;]
 Diana  | Ross    | [&amp;#34;Supremes&amp;#34;]
 Grace  | Slick   | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
        | Sting   | [&amp;#34;Police&amp;#34;]
 Stevie | Winwood | [&amp;#34;Spencer Davis Group&amp;#34;,&amp;#34;Traffic&amp;#34;,&amp;#34;Blind Faith&amp;#34;]
(6 rows)

=&amp;gt; SELECT QUOTE_LITERAL (fname) &amp;#34;First Name&amp;#34;, QUOTE_NULLABLE (lname) &amp;#34;Last Name&amp;#34;, band FROM lead_vocalists ORDER BY lname ASC;
 First Name | Last Name |                      band
------------+-----------+-------------------------------------------------
            | &amp;#39;Cher&amp;#39;    | [&amp;#34;Sonny and Cher&amp;#34;]
 &amp;#39;Mick&amp;#39;     | &amp;#39;Jagger&amp;#39;  | [&amp;#34;Rolling Stones&amp;#34;]
 &amp;#39;Diana&amp;#39;    | &amp;#39;Ross&amp;#39;    | [&amp;#34;Supremes&amp;#34;]
 &amp;#39;Grace&amp;#39;    | &amp;#39;Slick&amp;#39;   | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
 &amp;#39;&amp;#39;         | &amp;#39;Sting&amp;#39;   | [&amp;#34;Police&amp;#34;]
 &amp;#39;Stevie&amp;#39;   | &amp;#39;Winwood&amp;#39; | [&amp;#34;Spencer Davis Group&amp;#34;,&amp;#34;Traffic&amp;#34;,&amp;#34;Blind Faith&amp;#34;]
(6 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/language-elements/literals/string-literals/character-string-literals/#&#34;&gt;Character string literals&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/quote-nullable/#&#34;&gt;QUOTE_NULLABLE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: QUOTE_NULLABLE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-nullable/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/quote-nullable/</guid>
      <description>
        
        
        &lt;p&gt;Returns the given string suitably quoted for use as a string literal in an SQL statement string; or if the argument is null, returns the unquoted string &lt;code&gt;NULL&lt;/code&gt;. Embedded single-quotes and backslashes are properly doubled.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;QUOTE_NULLABLE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression &lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Argument that resolves to one or more strings to format as string literals. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; resolves to null value, QUOTE_NULLABLE returns &lt;code&gt;NULL&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples use the table &lt;code&gt;lead_vocalists&lt;/code&gt;, where the first names (&lt;code&gt;fname&lt;/code&gt;) for Cher and Sting are set to &lt;code&gt;NULL&lt;/code&gt; and an empty string, respectively&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * from lead_vocalists ORDER BY lname DESC;
 fname  |  lname  |                      band
--------+---------+-------------------------------------------------
 Stevie | Winwood | [&amp;#34;Spencer Davis Group&amp;#34;,&amp;#34;Traffic&amp;#34;,&amp;#34;Blind Faith&amp;#34;]
        | Sting   | [&amp;#34;Police&amp;#34;]
 Grace  | Slick   | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
 Diana  | Ross    | [&amp;#34;Supremes&amp;#34;]
 Mick   | Jagger  | [&amp;#34;Rolling Stones&amp;#34;]
        | Cher    | [&amp;#34;Sonny and Cher&amp;#34;]
(6 rows)

=&amp;gt; SELECT * FROM lead_vocalists WHERE fname IS NULL;
 fname | lname |        band
-------+-------+--------------------
       | Cher  | [&amp;#34;Sonny and Cher&amp;#34;]
(1 row)

=&amp;gt; SELECT * FROM lead_vocalists WHERE fname = &amp;#39;&amp;#39;;
 fname | lname |    band
-------+-------+------------
       | Sting | [&amp;#34;Police&amp;#34;]
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following query uses QUOTE_NULLABLE. Like &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/quote-literal/#&#34;&gt;QUOTE_LITERAL&lt;/a&gt;, QUOTE_NULLABLE sets off string values with single quotes, including empty strings. Unlike QUOTE_LITERAL, QUOTE_NULLABLE outputs &lt;code&gt;NULL&lt;/code&gt; for null values:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT QUOTE_NULLABLE (fname) &amp;#34;First Name&amp;#34;, QUOTE_NULLABLE (lname) &amp;#34;Last Name&amp;#34;, band FROM lead_vocalists ORDER BY fname DESC;
 First Name | Last Name |                      band
------------+-----------+-------------------------------------------------
 NULL       | &amp;#39;Cher&amp;#39;    | [&amp;#34;Sonny and Cher&amp;#34;]
 &amp;#39;Stevie&amp;#39;   | &amp;#39;Winwood&amp;#39; | [&amp;#34;Spencer Davis Group&amp;#34;,&amp;#34;Traffic&amp;#34;,&amp;#34;Blind Faith&amp;#34;]
 &amp;#39;Mick&amp;#39;     | &amp;#39;Jagger&amp;#39;  | [&amp;#34;Rolling Stones&amp;#34;]
 &amp;#39;Grace&amp;#39;    | &amp;#39;Slick&amp;#39;   | [&amp;#34;Jefferson Airplane&amp;#34;,&amp;#34;Jefferson Starship&amp;#34;]
 &amp;#39;Diana&amp;#39;    | &amp;#39;Ross&amp;#39;    | [&amp;#34;Supremes&amp;#34;]
 &amp;#39;&amp;#39;         | &amp;#39;Sting&amp;#39;   | [&amp;#34;Police&amp;#34;]
(6 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/language-elements/literals/string-literals/character-string-literals/#&#34;&gt;Character string literals&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REPEAT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/repeat/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/repeat/</guid>
      <description>
        
        
        &lt;p&gt;Replicates a string the specified number of times and concatenates the replicated values as a single string. The return value takes on the data type of the string argument. Return values for non-LONG data types and LONG data types can be up to 65000 and 32000000 bytes in length, respectively. If the length of &lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;code&gt;*&lt;/code&gt;&lt;em&gt;&lt;code&gt;count&lt;/code&gt;&lt;/em&gt; exceeds these limits, OpenText™ Analytics Database silently truncates the results.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REPEAT ( &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39;, &lt;span class=&#34;code-variable&#34;&gt;count&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to repeat, one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;CHAR&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VARCHAR&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;BINARY&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;VARBINARY&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;LONG VARCHAR&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;LONG VARBINARY&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;count&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;An integer expression that specifies how many times to repeat &lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example repeats &lt;code&gt;vmart&lt;/code&gt; three times:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REPEAT (&amp;#39;vmart&amp;#39;, 3);
     REPEAT
-----------------
 vmartvmartvmart
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REPLACE</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/replace/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/replace/</guid>
      <description>
        
        
        &lt;p&gt;Replaces all occurrences of characters in a string with another set of characters.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REPLACE (&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&amp;#39;, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;target&lt;/span&gt;&amp;#39;, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;replacement&lt;/span&gt;&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to modify.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The characters in &lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt; to replace.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;replacement&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The characters to replace &lt;em&gt;&lt;code&gt;target&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REPLACE(&amp;#39;Documentation%20Library&amp;#39;, &amp;#39;%20&amp;#39;, &amp;#39; &amp;#39;);
        REPLACE
-----------------------
 Documentation Library
(1 row)

=&amp;gt; SELECT REPLACE(&amp;#39;This &amp;amp;amp; That&amp;#39;, &amp;#39;&amp;amp;amp;&amp;#39;, &amp;#39;and&amp;#39;);
    REPLACE
---------------
 This and That
(1 row)

=&amp;gt; SELECT REPLACE(&amp;#39;straße&amp;#39;, &amp;#39;ß&amp;#39;, &amp;#39;ss&amp;#39;);
 REPLACE
---------
 strasse
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: RIGHT</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/right/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/right/</guid>
      <description>
        
        
        &lt;p&gt;Returns the specified characters from the right side of a string.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RIGHT ( &lt;span class=&#34;code-variable&#34;&gt;string-expr&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expr&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string expression to return.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;length&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;An integer value that specifies how many characters to return.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following query returns the last three characters of the string &#39;vertica&#39;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT RIGHT(&amp;#39;vertica&amp;#39;, 3);
 RIGHT
-------
 ica
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following query queries date column &lt;code&gt;date_ordered&lt;/code&gt; from table &lt;code&gt;store.store_orders_fact&lt;/code&gt;. It coerces the dates to strings and extracts the last five characters from each string. It then returns all distinct strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT DISTINCT(
  RIGHT(date_ordered::varchar, 5)) MonthDays
  FROM store.store_orders_fact ORDER BY MonthDays;
 MonthDays
-----------
 01-01
 01-02
 01-03
 01-04
 01-05
 01-06
 01-07
 01-08
 01-09
 01-10
 02-01
 02-02
 02-03
 ...
 11-08
 11-09
 11-10
 12-01
 12-02
 12-03
 12-04
 12-05
 12-06
 12-07
 12-08
 12-09
 12-10
(120 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/substr/#&#34;&gt;SUBSTR&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: RPAD</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/rpad/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/rpad/</guid>
      <description>
        
        
        &lt;p&gt;Returns a VARCHAR value representing a string of a specific length filled on the right with specific characters.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RPAD ( &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt; [ , &lt;span class=&#34;code-variable&#34;&gt;fill&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR OR VARCHAR) specifies the string to fill&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;length&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(INTEGER) specifies the number of characters to return&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;fill&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR OR VARCHAR) specifies the repeating string of characters with which to fill the output string. The default is the space character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT RPAD(&amp;#39;database&amp;#39;, 15, &amp;#39;xzy&amp;#39;);
      RPAD
-----------------
 databasexzyxzyx
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the string is already longer than the specified length it is truncated on the right:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT RPAD(&amp;#39;database&amp;#39;, 6, &amp;#39;xzy&amp;#39;);
  RPAD
--------
 databa
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: RTRIM</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/rtrim/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/rtrim/</guid>
      <description>
        
        
        &lt;p&gt;Returns a VARCHAR value representing a string with trailing blanks removed from the right side (end).&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RTRIM ( &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; [ , &lt;span class=&#34;code-variable&#34;&gt;characters&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) is the string to trim&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;characters&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;(CHAR or VARCHAR) specifies the characters to remove from the right side of &lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;. The default is the space character.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT RTRIM(&amp;#39;trimzzzyyyyyyxxxxxxxx&amp;#39;, &amp;#39;xyz&amp;#39;);
 RTRIM
-------
 trim
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/btrim/#&#34;&gt;BTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/ltrim/#&#34;&gt;LTRIM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/trim/#&#34;&gt;TRIM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHA1</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/</guid>
      <description>
        
        
        &lt;p&gt;Uses the US Secure Hash Algorithm 1 to calculate the &lt;code&gt;SHA1&lt;/code&gt; hash of string. Returns the result as a &lt;code&gt;VARCHAR&lt;/code&gt; string in hexadecimal.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHA1 ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;VARBINARY&lt;/code&gt; string to be calculated.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples calculate the &lt;code&gt;SHA1&lt;/code&gt; hash of the provided strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA1(&amp;#39;123&amp;#39;);
                   SHA1
------------------------------------------
 40bd001563085fc35165329ea1ff5c5ecbdbbeef
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA1(&amp;#39;Vertica&amp;#39;::bytea);
                   SHA1
------------------------------------------
 ee2cff8d3444995c6c301546c4fc5ee152d77c11
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/md5/&#34;&gt;MD5&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/&#34;&gt;SHA224&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/&#34;&gt;SHA256&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/&#34;&gt;SHA384&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha512/&#34;&gt;SHA512&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHA224</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/</guid>
      <description>
        
        
        &lt;p&gt;Uses the US Secure Hash Algorithm 2 to calculate the &lt;code&gt;SHA224&lt;/code&gt; hash of string. Returns the result as a &lt;code&gt;VARCHAR&lt;/code&gt; string in hexadecimal.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHA224 ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;VARBINARY&lt;/code&gt; string to be calculated.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples calculate the &lt;code&gt;SHA224&lt;/code&gt; hash of the provided strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA224(&amp;#39;abc&amp;#39;);
                      SHA224
----------------------------------------------------------
78d8045d684abd2eece923758f3cd781489df3a48e1278982466017f
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA224(&amp;#39;Vertica&amp;#39;::bytea);
                      SHA224
----------------------------------------------------------
 135ac268f64ff3124aeeebc3cc0af0a29fd600a3be8e29ed97e45e25
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT sha224(&amp;#39;&amp;#39;::varbinary) = &amp;#39;d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f&amp;#39; AS &amp;#34;TRUE&amp;#34;;
 TRUE
------
t
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/md5/&#34;&gt;MD5&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/&#34;&gt;SHA1()&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/&#34;&gt;SHA256()&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/&#34;&gt;SHA384()&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha512/&#34;&gt;SHA512()&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHA256</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/</guid>
      <description>
        
        
        &lt;p&gt;Uses the US Secure Hash Algorithm 2 to calculate the &lt;code&gt;SHA256&lt;/code&gt; hash of string. Returns the result as a &lt;code&gt;VARCHAR&lt;/code&gt; string in hexadecimal.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHA256 ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;VARBINARY&lt;/code&gt; string to be calculated.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples calculate the &lt;code&gt;SHA256&lt;/code&gt; hash of the provided strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA256(&amp;#39;abc&amp;#39;);
                              SHA256
------------------------------------------------------------------
 a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA256(&amp;#39;Vertica&amp;#39;::bytea);
                              SHA256
------------------------------------------------------------------
 9981b0b7df9f5be06e9e1a7f4ae2336a7868d9ab522b9a6ca6a87cd9ed95ba53
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT sha256(&amp;#39;&amp;#39;) = &amp;#39;e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855&amp;#39; AS &amp;#34;TRUE&amp;#34;;
 TRUE
------
t
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/md5/&#34;&gt;MD5&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/&#34;&gt;SHA1&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/&#34;&gt;SHA224&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/&#34;&gt;SHA384&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha512/&#34;&gt;SHA512&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SHA384</title>
      <link>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/data-type-specific-functions/string-functions/sha384/</guid>
      <description>
        
        
        &lt;p&gt;Uses the US Secure Hash Algorithm 2 to calculate the &lt;code&gt;SHA384&lt;/code&gt; hash of string. Returns the result as a &lt;code&gt;VARCHAR&lt;/code&gt; string in hexadecimal.&lt;/p&gt;
&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/immutable-invariant-functions/&#34; title=&#34;&#34;&gt;Immutable&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SHA384 ( &lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;string&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;VARBINARY&lt;/code&gt; string to be calculated.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following examples calculate the &lt;code&gt;SHA384&lt;/code&gt; hash of the provided strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA384(&amp;#39;123&amp;#39;);
                                              SHA384
--------------------------------------------------------------------------------------------------
 9a0a82f0c0cf31470d7affede3406cc9aa8410671520b727044eda15b4c25532a9b5cd8aaf9cec4919d76255b6bfb00f
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SHA384(&amp;#39;Vertica&amp;#39;::bytea);
                                              SHA384
--------------------------------------------------------------------------------------------------
 3431a717dc3289862bbd636a064d26980b47ebe4684b800cff4756f0c24985866ef97763eafd548fedb0ce28722c96bb
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/md5/&#34;&gt;MD5&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha1/&#34;&gt;SHA1&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha224/&#34;&gt;SHA224&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha256/&#34;&gt;SHA256&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/sha512/&#34;&gt;SHA512&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
