Escaping control characters in Oracle XDB

后端 未结 4 1231
南旧
南旧 2020-12-11 23:42

I\'m completely new to Oracle\'s XDB, in particular using it to generate XML output from a database table, and am working on an application which is moving from 9i (Oracle9i

4条回答
  •  孤街浪徒
    2020-12-12 00:07

    If you wish to keep line breaks, you may try like follows:

    select xmlelement("test", regexp_replace(test, '[^[:print:]|[:space:]]', '#')) from  
        (select '-   <- to keep line break after weird char
    -' test from dual ) 
    
    • replace all that ^ => is not in the sets (of printing [:print:] or space |[:space:] chars)

提交回复
热议问题