Changing a custom index to "Key Change=Yes"?

 5 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member

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
Send Private Message
Posts: 3351
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
Veteran Member Send Private Message
Posts: 709
Veteran Member
Thanks John. I'll give that a shot. I appreciate your help, once again. Kelly
Kelly Meade
J. R. Simplot Company
Boise, ID
jaherb
Veteran Member Send Private Message
Posts: 164
Veteran Member
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
Send Private Message
Posts: 3351
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
Veteran Member Send Private Message
Posts: 709
Veteran Member
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