43.11 GET_SLUG Function

Use this function to convert the input string to a "-" separated string, with special characters removed.

Syntax

FUNCTION GET_SLUG (
    p_string               IN VARCHAR2,
    p_hash_length          IN PLS_INTEGER DEFAULT 0 )
RETURN VARCHAR2;

Parameters

Table 43-8 GET_SLUG Function Parameters

Parameter Description

p_string

The input string.

p_hash_length

If > 0 (the default is 0), append a hash of the current timestamp to make the result unique.

Example

select apex_string_util.get_slug('hey now, brown cow! 1') from dual; 
-> hey-now-brown-cow-1
--
select apex_string_util.get_slug('hey now, brown cow! 1',4) from dual;
-> hey-now-brown-cow-1-3486