Last active
May 22, 2017 14:20
-
-
Save leandrogilvalle/d6de776ecb82ccd6308dc3ba3ce1e26a to your computer and use it in GitHub Desktop.
PLSQL Oracle - Função Regex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with separador_chaves as ( | |
| select regexp_substr(&p_valor,'[^;]+', 1, level) as chaves_e_valores | |
| from dual | |
| connect by regexp_substr(&p_valor,'[^;]+', 1, level) is not null | |
| ), | |
| valores_por_chaves as ( | |
| select substr(chaves_e_valores,instr(chaves_e_valores,'#')+1) as valor | |
| from separador_chaves | |
| where instr(chaves_e_valores,&p_chaves) > 0 | |
| ) | |
| select valor into v_retorno | |
| from valores_por_chaves; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment