Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle-SQL update statement?

Re: Oracle-SQL update statement?

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Fri, 29 Sep 2006 20:07:24 +0200
Message-ID: <efjn1r$b55$4@news5.zwoll1.ov.home.nl>


mike_at_zowee.com schreef:
> Can someone convert this to an Oracle-SQL update statement? The goal
> is to update tblWORKER.PER_TYPE based on the case statement. The
> essentials are there but I haven't been able to get the correct syntax.
> It was works until the WHERE EXISTS clause is added. Any ideas?
>
>
> UPDATE PS_RB_WORKER
> SET PER_TYPE = (SELECT
> CASE WHEN SUBSTR(MYTABLE.WORKER_NAME, 1, 5) = 'OnCal' THEN 'O'
> WHEN SUBSTR(MYTABLE.WORKER_NAME, 1, 5) = 'Depot' THEN 'P'
> WHEN MYTABLE.WORKER_JOBCODE = 'FSTA' AND MYTABLE.COMPANYID <> ' ' AND

Auwmygawd! Do you really insert a space to signify empty data?!? O - I know: you can't index NULLs, so this must perform better.

*sigh*

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Fri Sep 29 2006 - 13:07:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US