Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle-SQL update statement?
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
![]() |
![]() |