17 Then Daniel went home and told his friends Hananiah, Mishael, and Azariah what had happened. 18 He urged them to ask the God of heaven to show them his mercy by telling them the secret, so they would not be executed along with the other wise men of Babylon. 19 That night the secret was revealed to Daniel in a vision. Then Daniel praised the God of heaven.
He said, “Praise the name of God forever and ever,
for he has all wisdom and power.
21 He controls the course of world events;
he removes kings and sets up other kings.
He gives wisdom to the wise
and knowledge to the scholars.
22 He reveals deep and mysterious things
and knows what lies hidden in darkness,
though he is surrounded by light.
23 I thank and praise you, God of my ancestors,
for you have given me wisdom and strength.
You have told me what we asked of you
and revealed to us what the king demanded.”
Then Daniel went in to see Arioch, whom the king had ordered to execute the wise men of Babylon. Daniel said to him, “Don’t kill the wise men. Take me to the king, and I will tell him the meaning of his dream.”
Arioch quickly took Daniel to the king and said, “I have found one of the captives from Judah who will tell the king the meaning of his dream!”
26 The king said to Daniel (also known as Belteshazzar), “Is this true? Can you tell me what my dream was and what it means?”
27 Daniel replied, “There are no wise men, enchanters, magicians, or fortune-tellers who can reveal the king’s secret. 28 But there is a God in heaven who reveals secrets, and he has shown King Nebuchadnezzar what will happen in the future. Now I will tell you your dream and the visions you saw as you lay on your bed. 29 “While Your Majesty was sleeping, you dreamed about coming events. He who reveals secrets has shown you what is going to happen. 30 And it is not because I am wiser than anyone else that I know the secret of your dream, but because God wants you to understand what was in your heart.