Still getting duplicate runners in listMarketCatalogue!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JayBee
    Junior Member
    • Oct 2010
    • 114

    #1

    Still getting duplicate runners in listMarketCatalogue!!!

    I complained about this months ago.

    How can I run a database with duplicate Primary Keys?

    Has anyone got a workaround for this?

  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Yes - it is a pain in the neck.

    However, what I do is check to see if the runner already exists - if it does then I ignore it.

    Comment

    • bnl
      Junior Member
      • Nov 2012
      • 108

      #3
      However, what I do is check to see if the runner already exists - if it does then I ignore it.
      Or even better - handle the duplicate_key exception your db gives you.
      Code:
      Transaction.Start;
        begin
          Market.Insert;
        exception
          when duplicate_key => log_and_ignore;
        end;
        
        for Runner of Runners loop
          begin
            Runner.Insert;
          exception
            when duplicate_key => log_and_ignore;
          end;
        end loop;  
      Transaction.Commit;
      Or look at MERGE


      /Björn

      Comment

      Working...
      X