Friday 13 December 2019

Friday Funny - Festival of serious yahoos

I don't care what you all think, this is my blog, and I continue to laugh at this SQL joke.

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
If you're not aware, Yahoo Serious is an Australian actor from the movie of the same name. He made it onto Time magazine, then nothing.

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...

6 comments:

Tony said...

Don't you need "table"

select column_value
from table(apex_string.split('YAHOO~SERIOUS~FESTIVAL', '~'))
order by dbms_random.value

Scott Wesley said...

Not anymore, certainly not in 18c.

I'd give a reference, but google-foo low on these keywords. I know Connor has a post...

Jeff E. said...

Perhaps this is what you were referring to (https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9538717800346496712):

SQL> 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;

Scott Wesley said...

No, with Tony I'm talking about no longer having the need to use table() to invoke your table functions.
I have an email conversation with the OCDINumberList.

Stefan Dobre said...

If you're gonna go the apex_string way, at least go all out :)

select column_value
from apex_string.shuffle(apex_string.split('YAHOO~SERIOUS~FESTIVAL', '~'));

Scott Wesley said...

Oh that's good.