doc-exports/docs/dli/sqlreference/dli_08_0067.html
Su, Xiaomeng 04d4597cf3 dli_sqlreference_0511_version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2023-11-02 14:34:08 +00:00

236 lines
25 KiB
HTML

<a name="dli_08_0067"></a><a name="dli_08_0067"></a>
<h1 class="topictitle1">String Functions</h1>
<div id="body8662426"><p id="dli_08_0067__en-us_topic_0093947002_af032f3aca5824b9b95ddf55c3f5c32a3"><a href="#dli_08_0067__en-us_topic_0093947002_t444697a01050479d88c575e8b9fe777d">Table 1</a> lists the string functions supported by DLI.</p>
<div class="tablenoborder"><a name="dli_08_0067__en-us_topic_0093947002_t444697a01050479d88c575e8b9fe777d"></a><a name="en-us_topic_0093947002_t444697a01050479d88c575e8b9fe777d"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0067__en-us_topic_0093947002_t444697a01050479d88c575e8b9fe777d" frame="border" border="1" rules="all"><caption><b>Table 1 </b>String functions</caption><thead align="left"><tr id="dli_08_0067__en-us_topic_0093947002_r0c989dc7c0ab40b792c00e71d29b8a28"><th align="left" class="cellrowborder" valign="top" width="25.44%" id="mcps1.3.2.2.4.1.1"><p id="dli_08_0067__en-us_topic_0093947002_acd4cec65a26a4574a7c4949914123146">Function</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.12%" id="mcps1.3.2.2.4.1.2"><p id="dli_08_0067__en-us_topic_0093947002_ae19d8afb906a4ad685e655060d185a3f">Return Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.44%" id="mcps1.3.2.2.4.1.3"><p id="dli_08_0067__en-us_topic_0093947002_a4b141e3e049942159833df28f35de9ed">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dli_08_0067__en-us_topic_0093947002_r3b9b21092a214246a2967c31379da966"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_accc16a6b57c74df583f47ecd99e8ff06">ascii(string str)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_aa2dfbff6eb3943f4814b680ab2fc9f94">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a9dbf39dae7504b1b97852d0a495baff9">Returns the numeric value of the first character in a string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r6f18faca4f4a4ead8aa9b73ee0d62788"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a6dfdc34420334403b791900fd251522d">concat(string A, string B...)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a538e33ff5fd041399a315792db13ca1e">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a96f255bdaf9b400e8edb1b410f592fbd">Return a string resulting from concatenating the input strings. This function can take any number of input strings.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rcb471204d12b4d839afe78cd5dc46427"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ac6f58bd5b1ec41eaaa7d07db84148346">concat_ws(string SEP, string A, string B...)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_ab5233b610808426ab87c873b4127a80f">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aa4cc198f2be84d8592c7d5fd1fba3064">Return a string resulting from concatenating the input strings, which are separated by specified separators.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r2916b2cc24054a84ba77b43ae577b03a"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_af2b14048275a43fca8cdd581f1602ead">encode(string src, string charset)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a320c4e45f6b74eafa1986f3b1d39f3f0">BINARY</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aa96ed8b2e42c4c52bc7f94f490859387">Encode src in the encoding mode specified by charset.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r5c5581afd7254269a8e8d6ed462c7823"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a6fd6b653fe0e458e8bd80c04a4cb0c7a">find_in_set(string str, string strList)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a3f56535104a64c408d4d5890fd0419f0">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aed0353d409ae41349000b247e8d4ef45">Return the position of the first occurrence of str in strList. If the value of any parameter is <strong id="dli_08_0067__en-us_topic_0093947002_b92982609939">NULL</strong>, <strong id="dli_08_0067__en-us_topic_0093947002_b165754839939">NULL</strong> is returned. If the first parameter contains a comma (,), <strong id="dli_08_0067__en-us_topic_0093947002_b149616259939">0</strong> is returned.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r6d21bcb4c72d4a0ea158a05a0e1bd49e"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ab3ddd661028046e19bb23220b5106496">get_json_object(string json_string, string path)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a869c77aa8c57477fbb165b42b3d5558b">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aeb580feb70b74f88a794e06fcb634fea">Parse the JSON object in a specified JSON path. The function will return <strong id="dli_08_0067__en-us_topic_0093947002_b91239145171027">NULL</strong> if the JSON object is invalid.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rbcf7128a3dc145789f79ac9f0fdbdfe0"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a34e05950eff642d18aee3a231f2377d0">instr(string str, string substr)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a51c12c5b04ee422888118e9b81dfce29">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a341a30cafb0f4825a67ec6969a940091">Return the position of the first occurrence of substr in str. Return <strong id="dli_08_0067__en-us_topic_0093947002_b371695929939">NULL</strong> if <strong id="dli_08_0067__en-us_topic_0093947002_b660908799939">NULL</strong> is contained in the parameters and return <strong id="dli_08_0067__en-us_topic_0093947002_b579469999939">0</strong> if substr does not exist in str. Note that the subscripts start from 1.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r1f9af645c6084072aa54d1556b35ef76"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a061127f111264efb937c14e24430d0f2">length(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a5e8fd8bb1a264227ae71adc85b2bce9f">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aecfb1565808c41df96ac5be23856ecdd">Return the length of a string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r083d4a5f9da84a569d0a8d3c04c15541"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a39e2afc0130147b48685724919b3a921">locate(string substr, string str[, int pos])</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_aaa7ceb7f442847ca87df9a160777e91d">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_abfe714418f0044b590e1dcbc01e1ff5a">Return the position of the first occurrence of substr in str after position pos (starting from 1).</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rf2fc5c0b57f94a09b2715c280f1f8e57"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_aac5a42628271449ab061a4bd1b3a4da1">lower(string A) lcase(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_acfb89c4d63c049cf86d4382ab178c719">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a0d10287385cd4a1390586b464106fb4f">Convert all characters of a string to lower case.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rd835b3a659b24717b18befc54c1d53de"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a9cbdd89cf1704680a68d5cd0b5b50f65">lpad(string str, int len, string pad)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a0f8d2d8c971549419651c6ce5293d7e4">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_aa306822c05e04f6f803b791907e8c690">Return a string of a specified length. If the length of the given string (str) is shorter than the specified length (len), the given string is left-padded with pad to the specified length.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r00c3b3b367c5473fb690e05376200a47"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a85ce8b62b5c244679e2d34dbc8a29ddd">ltrim(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a552a4d7087344d3cb837715919ca39e1">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_ac9793cb81a30404da3ee1c550457ecf6">Trim spaces from the left hand side of a string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r02804c80def64040ac24558b0cc44208"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a6dacdc8c9915490eaeaf8da352fc43c4">parse_url(string urlString, string partToExtract [, string keyToExtract])</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a091db466a6ae4cd694f9fdb2ea4a9678">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_p6151228617365">Return the specified part of the specified URL. Valid values of partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO.</p>
<p id="dli_08_0067__en-us_topic_0093947002_p43840176173611">For example, <strong id="dli_08_0067__en-us_topic_0093947002_b24672853517121">parse_url ('http://facebook.com/path1/p.php?k1=v1&amp;k2=v2#Ref1 ',' HOST ')</strong> returns <strong id="dli_08_0067__en-us_topic_0093947002_b175110041717121">'facebook.com'</strong>.</p>
<p id="dli_08_0067__en-us_topic_0093947002_p29182178173536">When the second parameter is QUERY, the third parameter can be used to extract the value of a specific parameter. For example, <strong id="dli_08_0067__en-us_topic_0093947002_b1381579456171216">parse_url('http://facebook.com/path1/p.php?k1=v1&amp;k2=v2#Ref1', 'QUERY', 'k1')</strong> returns <strong id="dli_08_0067__en-us_topic_0093947002_b14928985171216">'v1'</strong>.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r8a6149933efd4e069ea5e49336b1b640"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a6bffc38a855846cdbf611d24baea730a">printf(String format, Obj... args)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a66c4c348884049bbb2cb4eb07f182fac">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a853e6eac33fc4f77ad09fb5ddbcd9c1a">Print the input according to a specified format.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_redac72f9c5aa44c892a272845c477578"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_afa149d9e5750486a8b787dd2b1d49600">regexp_extract(string subject, string pattern, int index)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_af0eb2faaf3084d2a96712aa97d76fa68">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a8ce9fb70858d453ebe487757558ce93d">Extract the string specified by the regular expression. <strong id="dli_08_0067__en-us_topic_0093947002_b440766609939">regexp_extract ('foothebar ',' foo (.*?) (bar) '2)</strong> returns <strong id="dli_08_0067__en-us_topic_0093947002_b611456209939">'bar.'</strong></p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r4f315c3ab38147d1b2ad2a56edb02f3a"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_aab181b4a852141dd87fe9e4da479806a">regexp_replace(string A, string B, string C)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_afe7ac4d0e5234d388057aa1060dae772">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a7418ea5403ed4fa48ccaddd185b6f41b">Replace character B in string A with character C.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r3964db137aed40d99e65717d0355bf55"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a6110913d7a034c6fb8197ae9f17ece4e">repeat(string str, int n)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_abeb2a70355a543f8ba95cdf9e36ef8a2">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a5f89dc78170d408f87b764852e6ef5e5">Repeat a string <em id="dli_08_0067__en-us_topic_0093947002_i258443539939">N</em> times.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r8a17e163387d47a1a5f244c48f63c672"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ab133ce03b9d54315bc86ca55f3cc4713">reverse(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_ada3cb7a93401465f8ee253f46f8d6714">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a9526eefcc8c44cd790cc1de58c0d82a2">Return the reversed string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r6a850e8103a741ddb6b09ad41b37490c"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ab4377230817040cc9c0ac2d2221d3303">rpad(string str, int len, string pad)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a8338b91aec9a4505be02fc0c285b41f5">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_acacf5f2edbf24e04aebbbb6fdfdf5c4f">Return a string of a specified length. If the length of the given string (str) is shorter than the specified length (len), the given string is right-padded with pad to the specified length.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r7bf278e1c7e546df9e3772980208c483"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ab5e6fcbd3f534c1b993bfcb653509c24">rtrim(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_aaf92ab4a52144b2d858ef23f81805644">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a5c8f7ac2159940d38ec0a587a97920ee">Trim spaces from the right hand side of a string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rafc56045baca477fb4f889944d3d1be4"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a775545c2651a411ea7184db6725a2169">space(int n)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a1ccf69ea0da8440dabf36a4d5af5c9ac">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_acd89a923d2eb415a9a067c8ce91bf84a">Returns a specified number of spaces.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rfaf96a6b94db4add8123ef7b7bdf0967"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ae49c39ecdd144c18bb37f6f58342072c">substr(string A, int start) substring(string A, int start)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a275c30e4297349dba0648b89b5a1cdc1">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_adbd5a23035c84eddbd41a2d1c1c5cce1">Return the substring starting from the specified start position in string A till the end of the string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r9fba7debf7d0468193b48818d1803735"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_ad78fcec47b5b4f23ba03eeb7ce4d355b">substr(string A, int start, int len) substring(string A, int start, int len)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a9f9d8cfeb474480ca6ad2b64575ebec1">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a95376b5c5534432e95a43200c256d772">Return the substring of a specified length starting from the specified start position in A string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r37abecd94fbb442e83a441c84e2478ee"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a78aad9d8d8af41e79e8c7731eb00e477">substring_index(string A, string delim, int count)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a60779562c7024f64bfe37a88e1ec5409">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_ae4103c3337994b5ea041ce0cb64f407b">Return the substring from string A before count occurrences of the delimiter delim.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r213fd4a840fe41fb98dee8f56e4a6ecc"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a47b1f75d0c114139b21a067cd25bffff">translate(string|char|varchar input, string|char|varchar from, string|char|varchar to)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a1648a5aed6674beebe7cb1ce319db8c8">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_ae390667d121346bbb8996a9ed3ccfd5f">Translate the input string by replacing the characters or string specified by from with the characters or string specified by to. For example, replace bcd in abcde with BCD using <strong id="dli_08_0067__en-us_topic_0093947002_b413277539939">translate ("abcde", "bcd", "BCD")</strong>.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r93c13fc217e14308a94c7c2799db8beb"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a3db791099380400b814d43807847283d">trim(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a66d58e37e84d441792699696398f3a1d">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a82079fd6743f4d78866530f3254f045e">Trim spaces from both ends of a string.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r3ffc683b75794fba80aa7ec6808c74fb"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_aad2e6019f04446468137cc7b5ed20dc0">upper(string A) ucase(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a7911f250c3f442809ea472c5c0e67635">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a1f68d92346be4ba487ee7be113ee97a1">Convert all characters of a string to upper case.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_rbcc1a2a07e9a46b9a393c5701ab85e27"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a0d967a3b6fa543158ceb0ec7db959384">initcap(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_a32dd6ff7cd8a46ff9ca13e380a1c9dc1">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a6fda89180369460fb472d41d362d2349">Convert the first letter of each word of a string to upper case and all other letters to lower case.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r48d5638418214a5eb2878b455e871612"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a1d8dc9bfb82a45ab96c4ff3f3526eb62">levenshtein(string A, string B)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_aab1b592232bd440285a79528b67ee8e6">INT</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_a5c60785291dd4a5dbdf558e5cacd3ab8">Return the Levenshtein distance between two strings. Example: <strong id="dli_08_0067__en-us_topic_0093947002_b1704495229171436">levenshtein ('kitten ',' sitting ') = 3</strong>.</p>
</td>
</tr>
<tr id="dli_08_0067__en-us_topic_0093947002_r745c163233a04996a0ddfa7f8ece19da"><td class="cellrowborder" valign="top" width="25.44%" headers="mcps1.3.2.2.4.1.1 "><p id="dli_08_0067__en-us_topic_0093947002_a2ad272a717954caba09b3973a1bc785c">soundex(string A)</p>
</td>
<td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.2.2.4.1.2 "><p id="dli_08_0067__en-us_topic_0093947002_ad16560aeca1d4f8a877799c1f767dbe3">STRING</p>
</td>
<td class="cellrowborder" valign="top" width="50.44%" headers="mcps1.3.2.2.4.1.3 "><p id="dli_08_0067__en-us_topic_0093947002_ab8231d38cfc84c369e37dce6b04db162">Return the soundex string from str. Example: <strong id="dli_08_0067__en-us_topic_0093947002_b135457299939">soundex ('Miller ') = M460</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0064.html">Built-in Functions</a></div>
</div>
</div>