How to escape <, >, and & characters to html entities in Oracle PL/SQL

前端 未结 2 1492
春和景丽
春和景丽 2020-12-31 03:12

I need to send HTML emails directly from oracle PL/SQL package. This works almost fine.

I have problem with the fact that some of the data fetched from a table conta

相关标签:
2条回答
  • 2020-12-31 03:46

    You can use the htf.escape_sc function:

    SQL> select htf.escape_sc('Please escape <this> tag') from dual;
    
    HTF.ESCAPE_SC('PLEASEESCAPE<THIS>TAG')
    ------------------------------------------------------------------
    Please escape &lt;this&gt; tag
    
    0 讨论(0)
  • 2020-12-31 03:53

    Also available is DBMS_XMLGEN.CONVERT which can handle a clob.

    Example:

    select DBMS_XMLGEN.CONVERT('<foo>') from dual
    

    Details: https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_xmlgen.htm

    0 讨论(0)
提交回复
热议问题