1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
WITH test
AS
(
SELECT ' BONJOUR. JE M''APPELLE FRIGOK. JE SUIS NUL EN PL/SQL.' str FROM dual
)
select rtrim(REPLACE(REPLACE(REPLACE(XMLAGG(XMLElement("x", etape_1.split) ORDER BY etape_1.split ASC),'<x>', ''),'</x>', '. '),'&'||'apos;',''''),'. ') AS phrase
from
(
SELECT ROWNUM,upper(substr(trim(regexp_substr (str, '[^.]+', 1, rownum)),1,1))||lower(substr(trim(regexp_substr (str, '[^.]+', 1, rownum)),2)) split
FROM test
connect BY level <= length (regexp_replace (str, '[^.]+')) + 1
)etape_1 |
Partager