ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

get sqlcode 80L when i used insert command

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

  • get sqlcode 80L when i used insert command

    HI ,
    I my SQCBLLE program i declared "A" file as out file and closed once completed writing the records in to it.

    after that i used the same file("A") as input file to read by declaring cursor in the same program.

    i fetched the record sucessfully with sql code zero and try to insert a record in to a PF which is having a KEY value.

    BUt when it insert a duplicate record it wil give 80L sql code instead of -803..

    and also givng the below messages

    Duplicate record key in member STUDENTF
    Duplicate key on access path.
    Duplicate key on access path.
    Duplicate key value specified.

    please guide me where i am doing wrong

  • #2
    Re: get sqlcode 80L when i used insert command

    Can you paste your program here pls ?
    Philippe

    Comment


    • #3
      Re: get sqlcode 80L when i used insert command

      How did you define SQLCOD? By including the SQLCA (Communications Area) or manually.
      80L is a representation of -803 (Characters between J and R represent negative values between -1 and -9), i.e. 80L is equivalent to -803.

      Birgitta

      Comment


      • #4
        Re: get sqlcode 80L when i used insert command

        How did you define SQLCOD? By including the SQLCA (Communications Area) or manually.
        80L is a representation of -803 (Characters between J and R represent negative values between -1 and -9), i.e. 80L is equivalent to -803.

        Birgitta

        Comment


        • #5
          Re: get sqlcode 80L when i used insert command

          Originally posted by B.Hauser View Post
          How did you define SQLCOD? By including the SQLCA (Communications Area) or manually.
          80L is a representation of -803 (Characters between J and R represent negative values between -1 and -9), i.e. 80L is equivalent to -803.

          Birgitta
          Hi Birgitta,

          Thanks for your reply
          i declared SQLCA with in Sql Begin declare and End declare
          here is the code for your review

          Code:
           
          EXEC SQL BEGIN DECLARE SECTION END-EXEC. 
           
           
          01 CUR_STATUS PIC X(1). 
          88 OPEN-CURSOR VALUE 'O'. 
          88 CLOSE-CURSOR VALUE 'C'. 
           
          01 HV_GOODF_REC. 
          05 HV_PARTY1 PIC X(10). 
          05 HV_PIN1 PIC X(06). 
          05 HV_TATUS1 PIC X(01). 
          05 HV_TYPE1 PIC X(01). 
           
          01 HV_RI PIC X(10). 
           
          EXEC SQL INCLUDE SQLCA END-EXEC. 
          EXEC SQL END DECLARE SECTION END-EXEC.
          please help on this

          Thanks
          giri
          Last edited by kitvb1; December 28, 2010, 06:16 AM. Reason: added code block using # icon/quotes using balloon icon

          Comment


          • #6
            Re: get sqlcode 80L when i used insert command

            What is "DECLARE SECTION" for or are you using Oracle DB ?

            Simply do somewhere in the "WORKING-STORAGE SECTION" :
            Code:
            WORKING-STORAGE SECTION.             
                EXEC SQL INCLUDE SQLCA END-EXEC.
            Philippe

            Comment

            Working...
            X