ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Update command on a file throwing " attempts to write duplicate record " error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Update command on a file throwing " attempts to write duplicate record " error

    Hi All ,

    This is very intersting thing i have observerd .

    in one of my programs i was trying to update field in a file using update opcode in rpg program , and it was throwing " attempts to write duplicate record ".

    But could not know the reason.

    i need your help urgently so requesting you.

    Thanks in advance.

    Kuldeep kishan . K

  • #2
    Re: Update command on a file throwing " attempts to write duplicate record " error

    ummm....look for a WRITE statement. if you are using WRITE instead of UPDATE then that's your problem (and sounds to me that is exactly what you are using)....unless the field you are updating is a key field in the file, if so then you are changing the value of the field to an existing matching record hence the attempt to write a duplicate.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Update command on a file throwing " attempts to write duplicate record " error

      I'm with Tom:

      Your update is changing the keys of the physical or one of its logicals to Key(s) that already exist.
      (I don't key physicals)

      Look for the words UNIQUE in the physical or one of the logicals.
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: Update command on a file throwing " attempts to write duplicate record " error

        i think i have got the answer now .. . actually the process was updating the key field before udpating the physical file where the error was thrown.

        Thanks a lot for your fast help..

        Comment

        Working...
        X