In Oracle/plsql, the SUBSTR functions allows you to extract a substring a string. The syntax for the SUBSTR function is:
substr (String, start_position, [length])
Description
The string is the source string.
Start_position is the position for extraction. The the position in the ' string is always 1.
The length is optional. It is the number of characters to extract. Ifthis parameter is omitted, substr'll return the entire string.
For example:
SUBSTR (' This are a test ', 6, 2) would return ' is '
SUBSTR (' This are a test ', 6) would return ' is a test '
substr (' Techonthenet ', 1, 4) would return ' Tech '
substr (' techonthenet ', -3, 3) would return ' Net '
substr (' Techonthenet ',-6, 3) would return ' the '
substr (' techonthenet ',-8, 2) would return ' on '
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/