Duplicate key on access path.

105 pts.
Tags:
AS 400
AS400 iseries
CL
CL Commands
IBM DB2
RPG
SQL
Stored Procedures
I have a physical file PF1 with some key fields(K1,K2,K3). PF1 has say 5 logical files with different keys(K1,K2...K5) I am trying to update only a field of PF1(that field is not a key in PF1) using SQL(stored procedures) PF1 has unique keyword mentioned.But the update is not made on key fields. That physical file field may or may not be a key in related logical files. While updating I am getting 'duplicate key on access path' error message. But UPDDTA works without any issue. Any guidance from anyone why this happens and how to correct this issue.Thanks in advance.
AP


Software/Hardware used:
AS400,ISERIES

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Check the logicals, there could be unique constrants on them also.
    50,415 pointsBadges:
    report
  • anuppdas
    Thanks philip for your suggestion..Have one more query..Are the unique constraints in logical causing this issue? not sure why UPDDTA can update the record without any problem. Or is that like UPDDTA is not dependant on logical files but SQL's on Physical files are dependant on logical files also.
    105 pointsBadges:
    report
  • philpl1jb

    Haven't got a handle on this one. 

    If your Sql were passing a null, upddta wouldn't .. it would be a blank or a zero. 

    It will not allow you to enter a key with a null value .. but shouldn't throw the error that you mentioned. 

    50,415 pointsBadges:
    report
  • CharlieBrowne
    It would have to be one of two things:
    1. The PF where you are doing UPDDTA is not the same PF the the stored procedure is using.
    2. More likely, the Stored procedure is changing more that just what the UPDDTA is doing. Can you get into DEBUG with the stored procedure to help determine the error?
    41,380 pointsBadges:
    report
  • TomLiotta
    We'd need to see (1) the code in the stored proc, and (2) the file definitions for PF1 and for all dependent files, before giving any answer better that what CharlieBrowne gave. If a 'duplicate key' is signalled, then one of the files' constraints is being violated. We can't guess why. -- Tom
    125,585 pointsBadges:
    report
  • RegnadKcin57
    Why not share with the readers, the specific details that the database shared with you, instead of saying\sharing only the paltry text "duplicate key on access path"?  Obtain the spooled joblog using LOG(4 0 *SECLVL) and then copy the SQL error message and the preceding database I/O error message(s) and add that to the discussion so everyone can review that.
    95 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following