Select for update (with database link)

stewartb

Member
When I try to execute the following statement:

SELECT t.* from schema.table@db_link t FOR UPDATE

The statement executes fine (and returns rows) but as soon as I click the "Edit Data" padlock icon I get the error message:

"These query results are not updateable. Include the ROWID to get updateable results."

Have tried adding "t.row_id, t.*" and it makes no difference.
 
Not knowing how PL/SQL Developer works in this area I tried to write an SQL*Plus "equivalent" as follows - which works fine.

Code:
DECLARE
  CURSOR c1 IS
    SELECT title
      FROM schema.table@db_link t
       FOR UPDATE OF title;

 v1    c1%ROWTYPE;

BEGIN
  OPEN c1;
  FETCH c1 INTO v1;

    UPDATE schema.table@db_link
      SET title = 'Updated across DB LINK'
     WHERE CURRENT OF c1;

     COMMIT;

  CLOSE c1;
END;
/
Is this not the way things are being done "under the skin"?

Have you found something in the Oracle documentation (10g) that states remote tables are not updateable?

Many thanks
 
Back
Top