Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!munnari.oz.au!bruce!labtam!cnw01!nigel From: nigel@cnw01.storesys.coles.oz.au (Nigel Harwood) Newsgroups: comp.databases Subject: Oracle CURSORS useless ? Keywords: Oracle CURSORS PRO*C Message-ID: <1274@cnw01.storesys.coles.oz.au> Date: 25 Jun 91 09:47:17 GMT Organization: Coles Myer Ltd., Melbourne, Australia Lines: 40 Okay, useless may be a bit strong, but not much. At least if this is true at any rate. I am beginning with PRO*C and my first program needs to read the rows from a table and modify each with values from a flat file before writing them back to the table. My first step was to set up a loop to display a test table to see that I had the basics correct. I did this by declaring a cursor, opening it, using a loop with a fetch to read through the rows selected. This worked as expected. My next step was to modify the fields with the information from the flat file, do an update to the table, and then a commit to complete the transaction etc. This failed with a "fetch out of sequence" error on the second row. On asking Oracle they said that you cannot do a commit in the middle of fetching ? In other words in doing what I want I can only do one commit and that's right at the end. How can I do that if I don't know how many records I might have in the table ? I've got something horribly wrong, right ? This can't be real, can it ? If I am forced to accept that this is the way of things, how do all you other Oracle programmers deal with this everyday processing loop ? Any help appreciated. Regards -- <<<<<<<<<<<<<<<<<<<<<<<<< Nigel Harwood >>>>>>>>>>>>>>>>>>>>>>>>>>> << Post: Coles Myer Ltd, PO Box 2000 Tooronga 3146, Australia >> << Phone: +61 3 829 6090 E-mail: nigel@cnw01.storesys.coles.oz.au >> << FAX: +61 3 829 6886 >>