Translate

শনিবার, ১৪ ডিসেম্বর, ২০১৩

What is SUBSTR functions and rVersion 11.1


SUBSTR functions
Definition:
The Oracle SUBSTR (SUBSTRING) function lets you extract a portion of a string (a 'substring') from a string of characters. 

The SUBSTR functions (SUBSTR, SUBSTRB, SUBSTRC, SUBSTR2, and SUBSTR4) return a portion of string, beginning at a specified position in the string. The functions vary in how they calculate the length of the substring to return.
  • SUBSTR calculates lengths using characters as defined by the input character set.
  • SUBSTRB calculates lengths using bytes.
  • SUBSTRC calculates lengths using Unicode complete characters.
  • SUBSTR2 calculates lengths using UCS2 code points.
  • SUBSTR4 calculates lengths using UCS4 code points.

Return Value

The return value is the same data type as string.
Syntax
{SUBSTR | SUBSTRB | SUBSTRC | SUBSTR2 | SUBSTR4}(char, position [, substring_length ])
Arguments
string
A text expression that is the base string from which the substring is created.

Oracle SUOrVersion 11.1




UBSTR (overload 2)
SUBSTR(
STR1 CLOB CHARACTER SET ANY_CS,
POS  NUMBER,                -- starting position
LEN  NUMBER := 2147483647)  -- number of characters
RETURN CLOB CHARACTER SET STR1%CHARSET;
Substring Beginning Of String
SELECT SUBSTR(<value>, 1, <number_of_characters>)
FROM DUAL;
SELECT SUBSTR('Take the first four characters', 1, 4) FIRST_FOUR
FROM DUAL;
Substring Middle Of String
SELECT SUBSTR(<value>, <starting_position>, <number_of_characters>)
FROM DUAL.
SELECT SUBSTR('Take the first four characters', 16, 4) MIDDLE_FOUR
FROM DUAL;

Substring End of String
SELECT SUBSTR(<value>, <starting_position>)
FROM DUAL;
SELECT SUBSTR('Take the first four characters', 16) SIXTEEN_TO_END
FROM DUAL;

SELECT SUBSTR('Take the first four characters', -4) FINAL_FOUR
FROM DUAL;

 Thank you 
Asraful















কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন

Popular Posts

show

click here