A StringTokenizer Function in PL/SQL

In this post, I will show two simple ways to create a StringTokenizer function in PL/SQL. One way is to use regular expressions using the functions REGEXP_SUBSTR and REGEXP_INSTR provided by Oracle. The Functions REGEXP_SUBSTR and REGEXP_INSTR are merely an extension of their function INSTR and SUBSTR in Oracle. The STRINGTOKENIZER_REGEX function, which you can see below, it behaves like the class StringTokenizer in Java, that’s by removing all the tokens that are NULL. The result will be a DBMS_SQL.varchar2_table with all valid tokens. Let’s see, now, the code:

Continue reading →