Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!warwick!nott-cs!lut.ac.uk!elaps From: elaps@lut.ac.uk (Alan Schwarzenberger) Newsgroups: comp.databases Subject: Re: Oracle CURSORS useless ? Message-ID: <1991Jun26.100717.17267@lut.ac.uk> Date: 26 Jun 91 10:07:17 GMT References: <1991Jun26.033043.22948@sunaus.oz> Organization: Loughborough University, UK. Lines: 32 I had a long running discussion with the Oracle help desk in the uk about this a few months back. A commit definitely closes the cursor. However, in version 6 of oracle, if you make a change to a column that is in your cursor, you'll see it immediately. For example If test_table has columns a, b, reject. EXEC SQL DECLARE C1 CURSOR FOR select a, b from test_table for update of reject; EXEC SQL OPEN C1; do { EXEC SQL FETCH C1 INTO :a, :b; /* other code */ if (condition) EXEC SQL UPDATE test_table SET reject=1 WHERE CURRENT OF C1; } while (more_rows); EXEC SQL CLOSE C1; EXEC SQL COMMIT; In this example, changes you make to the column reject are visible in the cursor C1 th next time you go round the do{}while loop. I use this because I need to know what other rows of data have already been rejected when I llok at the current row of data. I use Oracle RDBMS v6.0.30.3.1 running on HP9000 under HPUX, ProC v1.3.15.1.2 -- ============================================================================ Alan Schwarzenberger tel +44 509 222849 A.P.Schwarzenberger@lut.ac.uk International Electronics Reliability Institute, Loughborough University, UK