53.142 STRING_TO_TABLE Function (Deprecated)
Note:
This function is deprecated. Oracle recommends APEX_STRING.STRING_TO_TABLE
instead.
Given a string, this function returns a PL/SQL array of type APEX_APPLICATION_GLOBAL.VC_ARR2
. This array is a VARCHAR2(32767)
table.
Syntax
APEX_UTIL.STRING_TO_TABLE (
p_string IN VARCHAR2,
p_separator IN VARCHAR2 DEFAULT ':')
RETURN APEX_APPLICATION_GLOBAL.VC_ARR2;
Parameters
Table 53-106 STRING_TO_TABLE Parameters
Parameter | Description |
---|---|
p_string |
String to be converted into a PL/SQL table of type APEX_APPLICATION_GLOBAL.VC_ARR2 .
|
p_separator |
String separator. The default is a colon. |
Example
The following example demonstrates how the function is passed the string One:Two:Three
in the p_string
parameter and returns a PL/SQL array of type APEX_APPLICATION_GLOBAL.VC_ARR2
containing three elements: the element at position 1
contains the value One
, position 2
contains the value Two
, and position 3 contains the value Three
. This is then output using the HTP.P function call.
DECLARE
l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE('One:Two:Three');
FOR z IN 1..l_vc_arr2.count LOOP
htp.p(l_vc_arr2(z));
END LOOP;
END;
Parent topic: APEX_UTIL