2 Replies Latest reply on Mar 22, 2013 4:35 AM by 997986

    Oracle 10g - Insert in to Temporary Table - Record count mismatch between s

      We are trying insert records from a select query in to temporary table, some of the records is missing in the temporary table. The select statement is having multiple joins and union all which it little complex query. In simple terms the script contains 2 part 1st Part Insert in to temporary table 2nd part Select query with multiple joins, inline sub queries, unions and group by classes and conditions
      Eg. If we execute select statement alone it returns some count for example => 60000 After inserting into the temp table, in temp table the count is around 42000 why is the difference?

      It is simple bulk inserts... insert in to temp table select from xxx. also, there is no commit in between. The problem is all the records populated by the select statement are not inserted in to temp table. some records are not inserted.*
      Also, we had some other observation. It only happens in its 2nd execution and not its first run. Hope there might be some cache problem
      Even, we also did not believe that. We are wondering. In TOAD, we tested however at times it happens. In application jar file, after "insert in to temp select * from xxx" we take the i. record count of temp table and ii. record count of "select * from xxx" separately but both doesn't match. Match only at 1st time.

      Thank you in advance for your efforts and help.