Senthil Murugan's Blog

Home » Uncategorized » Oracle Undocumented Features

Oracle Undocumented Features

Very nice to learn string to table and table to string

http://stackoverflow.com/questions/381231/hidden-features-in-oracle

http://awads.net/wp/tag/undocumented/

SQL> declare
2    v_array apex_application_global.vc_arr2;
3    v_string varchar2(2000);
4 begin
5
6 -- Convert delimited string to array
7    v_array := apex_util.string_to_table('alpha,beta,gamma,delta', ',');
8 for i in 1..v_array.count
9    loop
10      dbms_output.put_line(v_array(i));
11 end loop;
12
13 -- Convert array to delimited string
14    v_string := apex_util.table_to_string(v_array,'|');
15    dbms_output.put_line(v_string);
16 end;
17 /
alpha
beta
gamma
delta
alpha|beta|gamma|delta
PL/SQL procedure successfully completed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: