The wisdom of the Lord came to David even in the night when he awoke to consider matters.