Adding a new index to EMPLOYEE fails

 5 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Robert
Veteran Member
Posts: 82
Veteran Member

    Gurus.

    I used to be happy...I used to have a 6 handicap....I used to have a full head of hair...then I started working with Lawson.
    It brings me to my knees every day.

    I defined a new index on EMPLOYEE, it is contatenated on COMPANY and FICA-NBR.  I did a debreorg.  I can initialize the index in 4GL and invoke an API call on it...but it fails after that.
    IOS reports that the index is invalid.

     

     

    Roger French
    Veteran Member
    Posts: 549
    Veteran Member

      Welcome to the choir.

      Did you do a blddbdict first before the reorg?

      Also did you do an IOSCacheRefresh after the reorg?

      Sam Simpson
      Veteran Member
      Posts: 239
      Veteran Member
        I think you need to include EMPLOYEE because it is part of the primary key or you can also use EMPSET4 or if you really need to inquire just the the SSN alone then either create a view or a relation table.
        Robert
        Veteran Member
        Posts: 82
        Veteran Member

          Roger -

          Yes, in that order.

          Sam -

          Well, I did try that.  I am using both Design Studio and 4GL here.  DS is hand for tesing the indexes.
          In Design Studio, if I do not initialize the company and ssn, EMPSET4 fails to return the record.  If I initialize the company and fica, I get one record returned, this suggest I should be able to read the table using an 840 api if I set the index values the same way.

          In 4GL this fails.

          MOVE PRM-COMPANY    TO DB-COMPANY.
          MOVE ZEROES                 TO DB-EMPLOYEE.
          MOVE SPACES                 TO DB-FICA-NBR.
          MOVE "999-90-9999"       TO DB-FICA-NBR.
          PERFORM 840-FIND-EMPSET4.
          DISPLAY "FOUND EMPLOYEE " EMP-FIRST-NAME.

          Sam Simpson
          Veteran Member
          Posts: 239
          Veteran Member
            NOPE. Your DB-EMPLOYEE is zero, Do you have an employee with zero EMPLOYEE id? If not then your 840 will fail. You have to use the FIND-NLT-EMPSET4 method. I forgot if it is 850 or 860 series. When you satisfy all the fields in an index then yes you can use the 840-FIND
            Robert
            Veteran Member
            Posts: 82
            Veteran Member
              Sam - yes, it's 850.

              At this point it would be redudant to built the custom index. But you given prudent advice. I am facing several new indexes and I believe you are right about including the PK attributes.

              So...this one can be closed.