Is there a function similar to the SPLIT () function similar to the C language in Oracle? ? ?

xiaoxiao2021-03-06  14

Create Type Tab_Str As Table of Varchar2 (30); /

Create or replace function to_table (p_str varchar2) Return Tab_stras ltab tab_str: = Tab_STR (); POS Integer: = 0; ls varcha2 (255): = p_str; begin pos: = INSTR (LS, ','); while Pos> 0 LTAB.EXTEND; LTAB (LTAB.COUNT): = Substr (LS, 1, POS - 1); LS: = Substr (LS, POS 1); POS: = INSTR (LS, ','); END LTAB.EXTEND; LTAB (LTAB.COUNT): = Ls; Return LTAB; END; / SELECT * FROM TABLE (Cast (to_table ('AB, CD, EF') AS Tab_STR));

转载请注明原文地址:https://www.9cbs.com/read-49140.html

New Post(0)