What does Psalm 40:7 mean?
This statement implies that David is available to the Lord for the performance of His will. The Psalms often refer to God's written Word as the source of wisdom and truth (Psalm 12:6; 40:8). The reference here to scrolls and book is the same: a mention of the written Scriptures. David was ready to do God's will, and he perceived that God's will was presented in these writings.That comment also points us prophetically to Jesus, who fulfilled every Scripture that identified Him as God's obedient servant. His life from conception to crucifixion and resurrection was prophesied in the Old Testament. He was the prophesied Messiah, who was obedient to God's will in all things, including His sacrifice for the sins of the whole world (1 John 2:2). In John 8:29 Jesus asserted, "And he who sent me is with me. He has not left me alone, for I always do the things that are pleasing to him."
The book of Hebrews cites this verse as part of an explanation of Jesus' role as Savior (Hebrews 10:5–7).