Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you do an IF EXISTS

446249Aug 11 2005 — edited Jun 28 2010
Hi, all. I'm new to the Oracle world, coming from the SQL Server world. I'm trying to do something like this,

if exists (select * from mytable where id = 12345) begin
-- do some processing on existing record
end
else begin
-- do some other processing
end

The only places I've seen EXISTS is in the WHERE clauses. Help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2010
Added on Aug 11 2005
21 comments
275,606 views