CREATE OR REPLACE TYPE mytable AS TABLE OF varchar2(100)
CREATE OR REPLACE FUNCTION split
(src VARCHAR2, delimiter varchar2)
RETURN mytable IS
psrc VARCHAR2(500);
a mytable := mytable();
i NUMBER := 1; --
j NUMBER := 1;
BEGIN
psrc := RTrim(LTrim(src, delimiter), delimiter);
LOOP
i := InStr(psrc, delimiter, j);
--Dbms_Output.put_line(i);
IF i>0 THEN
a.extend;
a(a.Count) := Trim(SubStr(psrc, j, i-j));
j := i+1;
--Dbms_Output.put_line(a(a.Count-1));
END IF;
EXIT WHEN i=0;
END LOOP;
IF j < Length(psrc) THEN
a.extend;
a(a.Count) := Trim(SubStr(psrc, j, Length(psrc)+1-j));
END IF;
RETURN a;
END;
SELECT * FROM student WHERE id IN (SELECT * FROM TABLE(CAST(split('001,002', ',')AS mytable)));
SELECT * FROM student WHERE id IN
(
SELECT id FROM student WHERE id='001'
UNION
SELECT * FROM TABLE(CAST(split('001,002',',') AS mytable))
);
C++ wants to achieve dynamic array effects like other languages need to use STL container, so the return value is stored in a Vector container, Vector container can access the elements in the queue ...
1. String 2. Split 3. Output...
String format "123,345,124,1234,123,4" Segmentation Analysis into 123 345 124 1234 123 4 Dynamic open space Effect...
The split method of the String class can split a string into an array of strings according to a specific separator. The parameter regex is a regular expression, and the string represented by the regex...
Python provides a very powerful string splitting method split, which can split a given string (s) according to a custom split character, generate a string list (ssl), and arrange the substrings after ...
STRTOK provided by C ++ for string array segmentation, don't say, on the code: Output results:...
table of Contents mind Mapping 1. Conversion between string and array 2. Case conversion 3. String processing-the return type is of type bool 4. Find the index value 5. String regular processing-retur...