1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Duplicate tabular form records getting inserted to table

Discussion in 'Oracle Application Express (APEX)' started by Bharat, Jul 22, 2015.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi All,

    We have created an Tabular form to load multiple records to table and wrote an custom pl/sql program to load those tabular form records to table.

    But its inserting duplicate records to the table. Like if we insert 2 then 4, if we insert 3 then 9 so on.. This was it was inserting records to the table. Can anyone suggest us to overcome this issue.
     
  2. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    I'm a pretty good PL/SQL programmer, but I simply cannot troubleshoot code that I have never seen. The best I can say from the description you gave is that you appear to have a LOOP problem. Somehow in your code, you have nested the loop performing the record insert. This at least is what would best explain that your count of INSERT records is being squared -- e.g. 2 records results in 4 INSERTs, 3 generates 9, 4 generates 16 (presumably), etc.

    However, without seeing the code -- that's simply a guess based on inadequate information.
     
  3. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi Matthew,

    This problem is resolved. What I did was, created process in apex page and written code with for loop to load all tabular form records. But Process was created using Tabular form. So what happened here is, for each row in tabular form it was calling that Process. So for loop is calling for those many times (how many records were there in the tabular form) and duplicates happened like that.

    Now created normal Process and it resolved the issue.
     
    Muhammad Uzair likes this.