16.9 LDAP_SEARCH_FILTER Function
The LDAP_SEARCH_FILTER
function escapes reserved characters in an LDAP search filter, according to RFC 4515. The RFC describes *()\/ as reserved characters (see p_reserved_chars
). These, non-printable characters (ascii 0 - 31) and ones with a code > 127 (see p_escape_non_ascii
) are escaped as \xx
, where xx
is the hexadecimal character code.
Syntax
APEX_ESCAPE.LDAP_SEARCH_FILTER (
p_string IN VARCHAR2,
p_reserved_chars IN VARCHAR2 DEFAULT c_ldap_search_reserved_chars,
p_escape_non_ascii IN BOOLEAN DEFAULT TRUE )
return VARCHAR2;
Parameters
Table 16-10 LDAP_SEARCH_FILTER Function Parameters
Parameter | Description |
---|---|
|
The text string that is escaped. |
|
A list of characters that when found in |
|
If TRUE, characters above ascii 127 in |
Example
This example escapes the text in l_name
and places the result in l_escaped
.
declare
l_name varchar2(4000) := 'Joe*User';
l_escaped varchar2(4000);
begin
l_escaped := apex_escape.ldap_search_filter(l_name);
htp.p(l_name||' becomes '||l_escaped);
end;
Note:
Parent topic: APEX_ESCAPE