The SUBSTR function returns len bytes from the pos position of RAW r.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
UTL_RAW.SUBSTR (
r IN RAW,
pos IN BINARY_INTEGER,
len IN BINARY_INTEGER DEFAULT NULL)
RETURN RAW;
Parameters
| Parameter | Description |
|---|---|
| r | The string from which to extract bytes. |
| pos | The position in r where the extraction starts. |
| len | The number of bytes to extract from r, starting at the pos position (optional). |
Default and optional parameters
| Optional parameter | Description |
|---|---|
| len | Extracts bytes from the pos position to the end of r. |
Return value
| Return value | Description |
|---|---|
| portion of r | The bytes starting at the pos position with a length of len bytes. |
| NULL | The input parameter r is NULL. |
Considerations
If
posis positive,SUBSTRstarts counting from the beginning ofrto find the first byte. Ifposis negative,SUBSTRstarts counting backward from the end ofr. Theposvalue cannot be 0.If you omit
len,SUBSTRreturns all bytes from the beginning ofrto the end. Thelenvalue must be at least 1.
Exceptions
| Exception | Description |
|---|---|
| VALUE_ERROR | The VALUE_ERROR exception is raised in the following cases:
|
