Now Solomon became a son-in-law to Pharaoh king of Egypt [and formed an alliance] by taking Pharaoh’s daughter [in marriage]. He brought her to the City of David [where she remained temporarily] until he had finished building his own house (palace) and the house of the LORD and the wall around Jerusalem. But [in the meantime] the people were still sacrificing [to God] on the high places (hilltops) [as the pagans did to their idols], for there was no [permanent] house yet built for the Name of the LORD.
Now Solomon loved the LORD, walking [at first] in the statutes of David his father, except [for the fact that] he sacrificed and burned incense in the high places [ignoring the law that required all sacrifices to be offered at the tabernacle]. [Lev 17:3, 4] The king went to Gibeon [near Jerusalem, where the tabernacle and the bronze altar stood] to sacrifice there, for that was the great high place. Solomon offered a thousand burnt offerings on that altar. In Gibeon the LORD appeared to Solomon in a dream at night; and God said, “Ask [Me] what I shall give you.”
Then Solomon said, “You have shown Your servant David my father great lovingkindness, because he walked before You in faithfulness and righteousness and with uprightness of heart toward You; and You have kept for him this great lovingkindness, in that You have given him a son to sit on his throne, as it is today. So now, O LORD my God, You have made Your servant king in place of David my father; and as for me, I am but a little boy [in wisdom and experience]; I do not know how to go out or come in [that is, how to conduct business as a king]. Your servant is among Your people whom You have chosen, a great people who are too many to be numbered or counted. So give Your servant an understanding mind and a hearing heart [with which] to judge Your people, so that I may discern between good and evil. For who is able to judge and rule this great people of Yours?” [James 1:5]
Now it pleased the Lord that Solomon had asked this thing. God said to him, “Because you have asked this and have not asked for yourself a long life nor for wealth, nor for the lives of your enemies, but have asked for yourself understanding to recognize justice, behold, I have done as you asked. I have given you a wise and discerning heart (mind), so that no one before you was your equal, nor shall anyone equal to you arise after you. I have also given you what you have not asked, both wealth and honor, so that there will not be anyone equal to you among the kings, for all your days. If you walk in My ways, keeping My statutes and My commandments, as your father David did, then I will lengthen your days.”
Then Solomon awoke, and he realized that it was a dream. He came [back] to Jerusalem and stood before the ark of the covenant of the LORD; he offered burnt offerings and peace offerings, and he prepared a feast for all his servants. [2 Sam 6:17]
Then two women who were prostitutes came to the king and stood before him.