select column_value from apex_string.split('YAHOO~SERIOUS~FESTIVAL', '~') order by dbms_random.value
If you're a Simpsons fan, you may recall this clip
Yahoo Serious Festival - The Simpsons |
But how nifty is that
apex_string.split
function? And it's cousin join
?Although recently I saw Connor use what appears to be a native option, one that doesn't require an APEX package. On the blog topic list...
Don't you need "table"
ReplyDeleteselect column_value
from table(apex_string.split('YAHOO~SERIOUS~FESTIVAL', '~'))
order by dbms_random.value
Not anymore, certainly not in 18c.
ReplyDeleteI'd give a reference, but google-foo low on these keywords. I know Connor has a post...
Perhaps this is what you were referring to (https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9538717800346496712):
ReplyDeleteSQL> select
2 t.contact_id,
3 regexp_substr(t.first_name, '[^\/]+', 1, c1.column_value) as fname,
4 regexp_substr(t.last_name, '[^\/]+', 1, c1.column_value) as lname
5 from
6 t,
7 table(cast(multiset(select level from dual connect by level <= length (regexp_replace(t.first_name, '[^\/]+')) + 1) as sys.OdciNumberList)) c1;
No, with Tony I'm talking about no longer having the need to use table() to invoke your table functions.
ReplyDeleteI have an email conversation with the OCDINumberList.
If you're gonna go the apex_string way, at least go all out :)
ReplyDeleteselect column_value
from apex_string.shuffle(apex_string.split('YAHOO~SERIOUS~FESTIVAL', '~'));
Oh that's good.
ReplyDelete