1. Overview

This blog talks about an example of splitting any special character string to an apex collection table using apex API.

2. Technologies and Tools Used

The following technologies have been used to achieve exporting IR data to Word format.

  • APEX UTIL API
  • PLSQL

3. Use Case

If we have any colon/comma separated string then it can be easily converted into a row using APEX UTIL API. Let’s see the example below,

4. Architecture 

Example: We have a string in the following format,

COLUMN_VALUE
A:B:C:D

And we need to convert it as follows,

COLUMN_VALUE
A
B
C
D

Code to split string has been given below,

PLSQL CODE:       

DECLARE

   lv_arr   apex_application_global.vc_arr2;

BEGIN

   lv_arr := apex_util.string_to_table (lv_arr, ‘:’);/*(‘:’ is  separator, we can use any characters)*/

   apex_collection.create_or_truncate_collection (‘STR_SPLITTER’);

   apex_collection.add_members (‘STR_SPLITTER’, lv_arr);

      END;

Now RUN below query to get the result,

O/P:

SELECT c001 COLUMN_VALUE

FROM apex_collections

WHERE collection_name = ‘STR_SPLITTER’

COLUMN_VALUE
A
B
C
D

 

Recent Posts

Start typing and press Enter to search