Oracle 转义HTML特殊字符

来源:互联网 发布:怎样申请淘宝直播 编辑:程序博客网 时间:2024/05/05 12:23

For example, 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 <this> tag


1. htf.escape_sc

This replaces characters that have special meaning in HTML with their escape sequences. The following characters are converted:

& to &amp; " to &quot: < to &lt; > to &gt;

The procedure version of this subprogram does the same thing as htp.prints and htp.ps.

Properties

Definitions

Syntax:

htf.escape_sc(ctext in varchar2) return varchar2;htp.escape_sc(ctext in varchar2);

Parameters:

ctext - the string to convert.

Generates:

The converted string.

2.  htf.escape_url

This replaces characters that have special meaning in HTML and HTTP with their escape sequences. The following characters are converted: & to &amp; " to &quot; < to &lt; > to &gt; % to %25

Properties

Definitions

Syntax:

htf.escape_url(p_url in varchar2) return varchar2;

Parameters:

p_url - the string to convert.

Generates:

The converted string.



转载自:https://sites.google.com/site/oracleworkstation/blog/oraclehtfescapesc







原创粉丝点击