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!

"if not exists" statement ??

883579Aug 20 2011 — edited Aug 20 2011
Hello

I'm working with PLSQL and I have a problem. I need to check if a field in my database is empty or full. If it is empty, the sql statement should be executed, if it's not, the statement should NOT be executed. I was checking out the "if not exists" statement but I can't implement it. Do you know how I can do that.
The field's name is winnerid, so if there's a winnerid integer assigned, the field should no longer take new values via updates.
That's the SQL code I have so far

"here should be the statement cheking if there's value in the field 'winnerid' " then
update taskauction set winnerid=100004 where taskid=50625

Again, if there's an integer(regardless of its value in the field winnerid), the statment "update taskauction set winnerid=100004 where taskid=50625" should not be executed, if the value in the field is null, then it should execute

Thanks for the help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2011
Added on Aug 20 2011
3 comments
246 views