Nardin, Simon wrote, on 11/10/2005 09:05:
Hi!

I'm using perl to access Oracle database. Everything is going well, but
now I have a question about using CursorName. I was searching on the net
for examples without success how to use cursors with "FOR UPDATE" and
"CURRENT OF" construct. Is this possible with Oracle using CursorName?
Maybe do you have an example? Is there an example how to select record
and immediatelly after that updating it?

FOR UPDATE part of the SQL language. You can use it from perl
just as you would from SQL*Plus or PL/SQL.

WHERE CURRENT OF is _not_ part of the SQL language. It is part
of PL/SQL, and, I believe, the Oracle pre-compiler products.
You can't use WHERE CURRENT OF from perl.

However, you can get exactly the same effect by using the
pseudo-column 'rowid'. This column described in the SQL Reference
Manual.

There is a PL/SQL example of using rowid instead of WHERE CURRENT
OF in the PL/SQL manual. Look for "Fetching Across Commits" in
the index.

--
Charles Jardine - Computing Service, University of Cambridge

Reply via email to