sql - Oracle locking with SELECT...FOR UPDATE OF -


I am selecting from food and bar tables I want to lock FOO record which is being returned , But I do not want to lock the bar's record.

  Select cursor c_foobar foo. *, times. * From Foo, to the bar where foo.id = bar.foo_id updates & lt; What should I be kept here? & Gt;  

It looks like I need to specify different columns, but I want the complete record of Fu locked. Like I believe I can do something like this:

  Select cursor c_foobar is foo. *, times. For foo, bar where foo.id = bar.foo_id foo updates  

do I foo to update to lock all the codes Calculate each column? Or can I choose any column in fu, even that which is not its primary key, and it will lock the whole record?

From

to:

While inquiring for several tables, You can use the UPDATE clause to limit row locking for tables. Rows in the table are locked only if the column refers to a column in the table for the update of the cloud. For example, the following query locks the rows in the table of employees, but not in the table of departments:

  DECLARE CURSOR c1 selected last_name, department_name employees, departments WHERE Employees.department_id = Departments department_ID and job_id = 'SA_MAN' for updating salary;  

Comments