PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07/28/2015 9:40 AM by  Woozy
Changing a custom index to "Key Change=Yes"?
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Woozy
Private
Private
Veteran Member
(3478 points)
Veteran Member
Posts:704


Send Message:

--
07/24/2015 12:10 PM

    Hi All,

    We are on LSF 9.0.1.11.  Sometime in the past, we created a custom index on HRHISTORY (HRHSET99) that has "Key Change = No".  We recently identified an error with a delivered program that was attempting update HRHISTORY and found that the error was because it is trying to change a field that is included in our custom index.

    Since the index is only used by one program, and is only used for query (not update), can I just change the index to "Key Change = Yes" and then recompile the program that uses it, or are there other impacts of making this change?

    If I do make this change, will I need to run dbreorg?  Will need to regenerate the indexes somehow? 

    Thanks!

    Kelly

     

    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    John Henley
    Private
    Private
    Senior Member
    (9596 points)
    Senior Member
    Posts:3216


    Send Message:

    --
    07/24/2015 12:59 PM
    Kelly,
    You should be able to make the change in dbdef, run blddbdict, and then dbreorg -d
    There is no physical change required to the database.
    Then recompile any programs that access the HRHISTORY table (probably easiest to do full recompile or at least HR, BN, PA, PR, LP, etc. )
    Thanks for using the LawsonGuru.com forums!
    John
    Woozy
    Private
    Private
    Veteran Member
    (3478 points)
    Veteran Member
    Posts:704


    Send Message:

    --
    07/27/2015 9:54 AM
    Thanks John. I'll give that a shot. I appreciate your help, once again.

    Kelly
    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    jaherb
    Private
    Private
    Veteran Member
    (471 points)
    Veteran Member
    Posts:163


    Send Message:

    --
    07/27/2015 5:42 PM
    Kelly..... I don't think you are going to get what you are looking for by doing that. You are not permitted to change key fields even with that field set to "Yes".
    That was for old Lawson logic.

    What I have had to do is write the logic to save the record, delete the table record and then re-create and add it again.

    Jim
    John Henley
    Private
    Private
    Senior Member
    (9596 points)
    Senior Member
    Posts:3216


    Send Message:

    --
    07/28/2015 6:09 AM
    Jim, I disagree. There are a number of indexes that include a status. When the status changes the row is updated not deleted and recreated.
    Thanks for using the LawsonGuru.com forums!
    John
    Woozy
    Private
    Private
    Veteran Member
    (3478 points)
    Veteran Member
    Posts:704


    Send Message:

    --
    07/28/2015 9:40 AM
    Jim/John - I am only using this custom index for query, but changing that flag appears to have resolved the errors that were happening when other indexes are used for update. Hopefully the issue is resolved, but we're stilll testing to validate.

    If we find more issues, I'll likely ping you back. Thanks for your help!
    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    You are not authorized to post a reply.