Thursday, September 9, 2010

O(h that doesn't work either?)racle, Fine.

For the amount of money our company pays every year to Oracle, i sure spend a lot of time cursing their name.

I spend a (un)fair amount of time finding "workarounds" to accomplish something in PLSQL that would have been a straightforward use of code in TSQL. Today's finding?

Code that would normally work in TSQL(Microsoft)

UPDATE            I_HATE_ORACLE
SET               TIMES_HATED = 233544
FROM              I_HATE_ORACLE HO,
                  HATE_REASONS HR
WHERE             HR.DESCRIPTION = 'Missing Keywords'
              AND HR.REASON_ID = HO.REASON_ID
              AND HO.PROGRAM_ID = 1



Doesn't work in PLSQL(Oracle). Instead i had to add 2 lines of extra code....and because i like to keep things formatted properly spacing-wise, it doubled the actual width of the query.

UPDATE            I_HATE_ORACLE
SET               TIMES_HATED = 233544
WHERE             HATE_ID IN (
                   SELECT            HATE_ID
                   FROM              I_HATE_ORACLE HO,
                                     HATE_REASONS HR
                   WHERE             HR.DESCRIPTION = 'Missing Keywords'
                                 AND HR.REASON_ID = HO.REASON_ID
                                 AND HO.PROGRAM_ID = 1)



It's not a HUGE deal...but being i already am opposed to our Oracle servers here, every added annoyance is amplified by that predisposition!  TSQL > PLSQL

"Oracle is like the child who lives in the corner who sells you the first glass of Lemonade for $0.25, and then sells you the second glass for $80,000 because it has the antidote."

No comments :