PL/SQL edit data & quot; these query results cannot be updated, please include ROWID or use SELECT... FOR UPDAT

Source: Internet
Author: User

If someone uses it:

Select t. * from table name t where field = xxx for update

Instead:

Select t. rowid, t. * from table name t where field = xxx for update

This is the case when you update data.

For update does not contain rowid. It is a silly behavior, just like using svn to modify source code without getting the latest one.

If this operation is performed in the real database at the customer's site, the customer's business processing will be suspended, and the consequences will be very serious.

Therefore, in the project team, especially new users, they need to emphasize the relevant operational specifications so that the relevant actions form a habit.

To query who has locked the entire table, refer to the following statement:

"

---- Query the oracle user name, machine name, and lock table object

SELECT l. session_id sid, s. serial #, l. locked_mode, l. oracle_username,

L. OS _user_name, s. machine, s. terminal, o. object_name, s. logon_time

FROM v $ locked_object l, all_objects o, v $ session s

WHERE l. object_id = o. object_id

AND l. session_id = s. sid

Order by sid, s. serial #;

"

For more details, see:

Http://www.cnblogs.com/hangwq/p/3527969.html

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.