Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Question on SQL%rowcount value

Question on SQL%rowcount value

From: Ubiquitous <weberm_at_polaris.net>
Date: Mon, 12 May 2003 13:43:52 +0000 (UTC)
Message-ID: <b9o8eo$5fn$1@news.utelfla.com>


Just a quick question.

I have a stored procedure which inserts rows to a table from a data file, then updates the newly-added rows with values in the footer of the load file. I used SQL%rowcount to determine if the last step was successfull and decided to display the number of rows updated, but I don't seem to be getting the currect value. Below is a sample of the program; does anyone have any idea what's going on? Thanks!

BEGIN
/* open file stuff */

  LOOP
    BEGIN

      utl_file.get_line(v_infile_handle,v_file_buffer);
      EXIT WHEN SUBSTR(v_file_buffer,1,6) = 'FOOTER'
      v_counter := v_counter + 1;
      get_rec(v_file_buffer,closeout_detail_rec); -- Edit & format load data
      insert_rec(closeout_detail_rec);
      EXCEPTION
        /*blah blah blah */

    END;
  END LOOP;
    /* coding which edits and formats footer data */   UPDATE closeout_detail
    SET /* blah blah blah */
   WHERE closeout_detail_rec.id = closeout_detail.id;

  IF SQL%rowcount = 0 THEN

     RAISE footer_totals_not-set;
  ELSE
     dbms_output.put_line(SQL%rowcount || ' rows updated with footer data');   END IF;
  COMMIT;
/* close file stuff */

  EXCEPTION
/* blah blah blah */

END; Received on Mon May 12 2003 - 08:43:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US