tag:blogger.com,1999:blog-15861274.post2576207396364451697..comments2023-09-18T11:14:24.509+01:00Comments on Oracle WTF: One linerWilliam Robertsonhttp://www.blogger.com/profile/06976436975493102341noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-15861274.post-75695208213642744642008-05-19T16:03:00.000+01:002008-05-19T16:03:00.000+01:00That looks like it was machine-generated by someth...That looks like it was machine-generated by something else, to me, and then pushed into Oracle...<BR/><BR/>But then why not just work out the decode in the other language? Mysterious.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15861274.post-11324417013894217002007-08-10T06:13:00.000+01:002007-08-10T06:13:00.000+01:00Hooray! Welcome back ;-)Damn Sploggers :-(Hooray! Welcome back ;-)<BR/><BR/>Damn Sploggers :-(Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15861274.post-34721907637947716012007-05-04T01:28:00.000+01:002007-05-04T01:28:00.000+01:00Yes I think the nvl is intended as a distraction f...Yes I think the nvl is intended as a distraction from the uselessness of the decode. This variation was particularly cunning.<BR/><BR/>nvl(<BR/> nvl(decode(2, 1, 'f', 2, 'g', 3, 'h', 4, 'i', 5, 'j', ' '), 'na'),<BR/> nvl(decode(2, 1, 'k', 2, 'l', 3, 'm', 4, 'n', 5, 'o', ' '), 'na')<BR/> )3360https://www.blogger.com/profile/15154122363413824960noreply@blogger.comtag:blogger.com,1999:blog-15861274.post-55874323661216718252007-05-03T20:44:00.000+01:002007-05-03T20:44:00.000+01:00Even if sometimes a 2 isn't a 2, the NVL in this c...Even if sometimes a 2 <B>isn't</B> a 2, the NVL in this code is pointless. The default value of ' ' at the end of the decode guarantees that the decode will never return a null.Danhttps://www.blogger.com/profile/09185797913734356446noreply@blogger.comtag:blogger.com,1999:blog-15861274.post-83997868380041565192007-05-03T12:39:00.000+01:002007-05-03T12:39:00.000+01:00Ooooops, right! :-)Ooooops, right! :-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15861274.post-53588717230311992132007-05-03T10:25:00.000+01:002007-05-03T10:25:00.000+01:00Anonymous, you need to look more carefully:decode(...Anonymous, you need to look more carefully:<BR/><BR/>decode(2,...<BR/><BR/>This code takes the constant number 2 and then determines whether it is a 1, 2, 3, 4, 5 or other value. Last time I checked, a 2 was always a 2...Tony Andrewshttps://www.blogger.com/profile/16750945985361011515noreply@blogger.comtag:blogger.com,1999:blog-15861274.post-40303498339748386042007-05-03T09:44:00.000+01:002007-05-03T09:44:00.000+01:00What about using the null in the decode? He/she ne...What about using the null in the decode? He/she needed just one function, not two :-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15861274.post-33177675788011541872007-05-03T09:20:00.000+01:002007-05-03T09:20:00.000+01:00Sorry, where is the WTF?Sorry, where is the WTF?Anonymousnoreply@blogger.com