LDAP_DN function escapes reserved characters in an LDAP distinguished name, according to RFC 4514. The RFC describes "+,;<=>\ as reserved characters (see
p_reserved_chars). These are escaped by a backslash, for example, " becomes \". Non-printable characters, ascii 0 - 31, and ones with a code > 127 (see
p_escape_non_ascii) are escaped as
xx is the hexadecimal character code. The space character at the beginning or end of the string and a # at the beginning is also escaped with a backslash.
APEX_ESCAPE.LDAP_DN ( p_string IN VARCHAR2, p_reserved_chars IN VARCHAR2 DEFAULT c_ldap_dn_reserved_chars, p_escaped_non_ascii IN BOOLEAN DEFAULT TRUE ) return VARCHAR2;
Table 9-9 LDAP_DN Function Parameters
The text string that is escaped.
A list of characters that when found in
If TRUE, characters above ascii 127 in
This example escapes characters in
l_name and places the result in
declare l_name varchar2(4000) := 'Joe+User'; l_escaped varchar2(4000); begin l_escaped := apex_escape.ldap_dn(l_name); htp.p(l_name||' becomes '||l_escaped); end;