User Tools

Site Tools


Sidebar

**HPL/SQL is included to Apache Hive since version 2.0** * [[home|Home]]\\ * [[why|Why HPL/SQL]]\\ * [[features|Key Features]]\\ * [[start|Get Started]]\\ * [[doc|HPL/SQL Reference]]\\ * [[download|Download]]\\ * [[new|What's New]]\\ * [[about|About]]

substr

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== SUBSTR Function - PL/HQL Reference====== SUBSTR function returns a substring from string. **Syntax**: <code language="sql"> SUBSTR(string, start_pos [, substring_len]) </code> **Parameters:** | **Parameter** | **Type** | **Value** | **Description** | | string | String | Variable or expression | Original string | | start_pos | Integer | Variable or expression | Start position of substring (starts from 1) | | substring_len | Integer | Variable or expression | Length of substring | **Notes**: * If start_pos is 0 then it is treated as 1 * SUBSTR and [[substring|SUBSTRING]] functions are synonyms **Return Type:** String. **Example:** <code language="sql"> SUBSTR('Remark', 3); </code> Result: 'mark' **Example:** <code language="sql"> SUBSTR('Remark', 3, 3); </code> Result: 'mar' **Compatibility**: Oracle and IBM DB2. **See also**: * [[substring|SUBSTRING]] **Version**: PL/HQL 0.01