Previous
Previous
 
Next
Next


TABLE_TO_STRING Function

Given a a PL/SQL table of type APEX_APPLICATION_GLOBAL.VC_ARR2, this function returns a delimited string separated by the supplied separator, or by the default separator, a colon (:).

Syntax

APEX_UTIL.TABLE_TO_STRING (
    p_table       IN     APEX_APPLICATION_GLOBAL.VC_ARR2,
    p_string      IN     VARCHAR2 DEFAULT ':') 
RETURN VARCHAR2;

Parameters

Table: TABLE_TO_STRING Parameters describes the parameters available in the TABLE_TO_STRING function.

TABLE_TO_STRING Parameters

Parameter Description

p_string

String separator. Default separator is a colon (:)

p_table

PL/SQL table that is to be converted into a delimited string


Example

The following example shows how to use the TABLE_TO_STRING function. The example first calls STRING_TO_TABLE which 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 3 elements, the element at position 1 contains the value 'One', position 2 contains the value 'Two' and position 3 contains the value 'Three'. This array is then passed in to the TABLE_TO_STRING function in the p_string parameter, which then returns back the original string 'One:Two:Three'.

DECLARE
    l_string     VARCHAR2(255);
    l_vc_arr2    APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE('One:Two:Three');
    l_string := APEX_UTIL.TABLE_TO_STRING(l_vc_arr2);
END;