Solomon offers a prayer for the continuity of the royal dynasty, recognizing that the divine promise depends heavily on the actions of future generations. He reflects on the guarantee God made to David, which ensured that the royal lineage would never cease from his offspring. However, the commentators agree that this promise is not absolute. Instead, it is strictly conditional on his descendants being righteous and remaining entirely faithful to God's ways.
The specific requirement for these future kings is to walk in the path of the Torah. Highlighting a shift in how this condition is presented, [מלבי״ם] notes a contrast with a parallel account. While the other record simply requires the kings to walk before God, the demand here is explicitly defined as walking directly within the instruction of the Torah.