WHERE CURRENT OF cursor within the

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Thu, 11 Nov 2004 3:58 pm

Could someone explain to me using the WHERE CURRENT OF???

Thank you!!!
Location: Novo Hamburgo - RS

Poston Thu, 11 Nov 2004 4:04 pm

The Where Current OF if uses when he wants to do an UPDATE on the current record of the cursor.

Here's a basic example:
Code: Select all
  cursor cur1 is select i, c from test_for_cursor for update;
  for aa in cur1 loop
    if aa.i>12 then
      update test_for_cursor set i=i*2, c=upper(c) where current of cur1;
    end if;
  end loop;
Note that it is not necessary to place key or anything.
You can do the same if you retrieve the ROWID in the column, then just make a
Code: Select all
WHERE rowid= vur1.rowid
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?

  • See also
    Last Post

    Return to SQL

    Who is online

    Users browsing this forum: No registered users and 3 guests