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 -> SQL Accurate count of records deleted

SQL Accurate count of records deleted

From: <eholub_at_osc.state.ny.us>
Date: Mon, 19 Apr 1999 16:08:19 -0400
Message-ID: <FF60E63802C414F5006DDD9C85256758.006D6D4F85256758@ERS1.osc.state.ny.us>


Is there a way other that using select count(*) to obtain an accurate number of LIKE-KEYED records that are deleted as a result of this coding:'

DECLARE ADJ-CUR CURSOR FOR       SELECT $LIST-DB2 AREA WS-ADJ

                     PREFIX YES 
 

    FROM TADJBB  

    WHERE ID_EMPR     = :RPT-ID-EMPR-LOC AND 
          DTE         = :RPT-DTE-RPT AND 
          ID_EMPR_RPT = :RPT-ID-EMPR-RPT-CDE AND 
          NUM_RPT     = :RPT-NUM-RPT-SEQ 
  END-EXEC.     EXEC SQL
       OPEN ADJ-CUR
  END-EXEC. The fetch is then done and if a good return code, then 1 is added to ADJBB-RECS-READ.
In reality, I found this is the number of ADJBB-RECORDS-DELETED. Since the above key
is matched, although the rest of the record is unique, the actual number of records deleted
is in reality much higher than the counter indicates. (The number of records read is actually the number of records deleted based on this code.) I know a select count(*) would return the correct number to be deleted but count(*) only works Received on Mon Apr 19 1999 - 15:08:19 CDT

Original text of this message

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