1. Intercepting strings
The Oracle intercept string uses a function substr, with the parameters: substr (string, start position, intercept length),
For example: String 123,112, you need to remove the trailing comma, then the Intercept function is as follows:
Select substr (' 123,112, ', 0,length (' 123,112, ')-1) from dual;
Results: 123,112
2. Replace string
Using functions: Replace,
As follows:
Result: think of that year, back, Qi swallow miles like wolves
3. String concatenation
String and string concatenation using | | Symbol, if there is a single quotation mark in the string, use double single quotes, which represents a single quotation mark, and so on.
For example:
Select ' (A.serialid in (' | | | 123| | ') OR NVL (A.serialid, ' 0 ')! = ' 0 ') ' from dual;
Results:
(A.serialid in (123) OR NVL (A.serialid, ' 0 ')! = ' 0 ')
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Oracle-018:oracle Tips 001 String Handling