lucasmouraahere

Função Oracle INSTR

Jun 26th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.19 KB | None | 0 0
  1. -- RETORNA A POSIÇÃO DO CARACTERE QUE ESTÁ SENDO SETADO NO PARÂMETRO
  2. --obs: É CASE SENSITIVE
  3.  
  4. SELECT INSTR('O Aprendaplsql é o melhor site', 'a')
  5.   FROM dual;
  6.  
  7. SELECT INSTR('O Aprendaplsql é o melhor site', 'e', 10)
  8.   FROM dual;
  9.  
  10. SELECT INSTR('O Aprendaplsql é o melhor site', 'e', 10, 2)
  11.   FROM dual;
  12.  
  13. SELECT INSTR('O Aprendaplsql é o melhor site', 'e', -1)
  14.   FROM dual;
  15.  
  16. SELECT SUBSTR('O Aprendaplsql é o melhor site',
  17.         INSTR('O Aprendaplsql é o melhor site', 'A'), 12)
  18.   FROM dual;
  19.  
  20. SELECT SUBSTR('teste' ,INSTR('O Aprendaplsql é o melhor site', 'A'), 6)
  21.   FROM dual;
  22.  
  23. SELECT instr2('O Aprendaplsql é o melhor site', 'e', -3)
  24.   FROM dual;
  25.  
  26. SELECT INSTR('O Aprendaplsql é o melhor site', 'e', -3)
  27.   FROM dual;
  28.  
  29. SELECT INSTR('O Aprendaplsql é o melhor site', 'a')
  30.   FROM dual;
  31.  
  32. SELECT regexp_instr('O Aprendaplsql é o melhor site', 'a', 1, 1, 0, 'i')
  33.   FROM dual;
  34.  
  35. SELECT regexp_instr('O Aprendaplsql é o melhor site', 'a', 1, 1, 0, 'c')
  36.   FROM dual;
  37.  
  38. SELECT regexp_instr('O Aprendaplsql é o melhor site', 'a|e|i|o|u')
  39.   FROM dual;
  40.  
  41. SELECT regexp_instr('O Aprendaplsql é o melhor site', 'a|e|i|o|u', 1, 1, 0, 'i')
  42.   FROM dual;
Advertisement
Add Comment
Please, Sign In to add comment