0 Replies Latest reply on Sep 23, 2008 5:46 AM by 661131

    Weird problem with bulk insert using OraParameter as binding arrays...

    661131
      Hi,

      I'm trying use OraParameter objects to to a batch insert against a table. When I actually execute the SQL statement, I am getting a 4139 error (something to do with Arrays), and consulting the associated error log, I find it to be full of junk like this:

      Quote:

      ORA-00001: unique constraint (NJT_UAT.ROSDET_UKY) violated
      , Message 201 not found; No message file for product=OO4O, facility=OIP 1
      ORA-00001: unique constraint (NJT_UAT.ROSDET_UKY) violated
      , Message 201 not found; No message file for product=OO4O, facility=OIP 2
      ORA-00001: unique constraint (NJT_UAT.ROSDET_UKY) violated
      , Message 201 not found; No message file for product=OO4O, facility=OIP 3
      ORA-00001: unique constraint (NJT_UAT.ROSDET_UKY) violated
      , Message 201 not found; No message file for product=OO4O, facility=OIP 4
      ORA-00001: unique constraint (NJT_UAT.ROSDET_UKY) violated
      , Message 201 not found; No message file for product=OO4O, facility=OIP 5
      ....

      Here's the problem - there is no way that this data is causing an error against the unique key it names. No way. I've deleted all possible values that could be used prior to running the query (same transaction as the Insert), and part of the key is a sequential number that I know is being generated with different values each time (It's in a loop, and I have inspected the content of the array to be sure)

      And this is where it gets really freaky - I've written some code to take the OraParameters objects, and use them to work out a load of simple sql statements to use in their place, and lo and behold that goes through without any problems! Records inserted - no violations - but slow of course...

      I really want to batch INSERT this data using OraParameter objects (speed) - Anyone got the slightest idea what's going on?

      Martin