Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 'IF EXISTS' functionality in Oracle SQL
In article <38cce005$0$25792_at_lithium.news.uk.uu.net>, Steve Ball
<steve_at_REMOVEMEsdball.com> writes
>All,
>
>I have some SQL written that worked on a Sybase or MS SQL Server db, but not
>Oracle:
>
>if exists (select ...)
>update my_table
>set my_table.status = "65"
>where
>my_table.id = ...
How about...
UPDATE my_table
SET status = "65"
WHERE id = xxx
AND NOT EXISTS (
SELECT 1 FROM my_table WHERE id = yyy AND blah, blah, blah )
Andy
--
Andy Hardy. PGP key available on request