I am having trouble with an IF statement in a SQL block for updating a table value. I have a table (bonus) that has an attribute sal NUMBER(7,2). The current value of sal is 0.
If I use: IF sal = 0 THEN UPDATE bonus set sal = 1250 WHERE ENAME = 'MARTIN'; END IF; .. the value of sal is not updated with 1250 But if I use: IF sal = 0 THEN UPDATE bonus set sal = 1250 WHERE ENAME = 'MARTIN'; ELSE UPDATE bonus set sal = 1250 WHERE ENAME = 'MARTIN'; END IF; .. then the value of sal is updated with 1250 Could someone please show me what I am doing wrote? How can I use the CASE conditional statement to accomplish the same as above? Thanks in advance. -- dkwema __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12ham2tqe/M=362335.6886445.7839731.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1122984568/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
