SQL % NOTFOUND and SQL % NOTFOUND

Source: Internet
Author: User

SQL % NOTFOUND and SQL % NOTFOUND

SQL % NOTFOUND is a Boolean value. Interacts with the latest SQL statement (update, insert, delete, select). If the latest SQL statement does not involve any rows, true is returned. Otherwise, false is returned. Such statements are very useful in practical applications. For example, if you want to update a row of data, you can perform the operation if it is not found. For example:

Begin

Update salary set bonus = 1000 where emp_id = 10;

If SQL % notfound then

Insert salary (bonus) valuees (100 );

End if;

.................

When the row record with update emp_id 10 does not exist, an exception is thrown.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.