2 Chronicles 6:38

If they return to thee with all their heart and with all their soul in the land of their captivity, whither they have carried them captives, and pray toward their land, which thou gavest unto their fathers, and toward the city which thou hast chosen, and toward the house which I have built for thy name:

This verse belongs to Solomon's prayer offered after the temple was erected and built, at its dedication. He prayed it vocally and aloud while kneeling on a brazen scaffold in the presence and hearing of the people of Israel, and its words are preserved in the Bible. The prayer was answered when fire was sent from heaven that consumed the burnt offering, and afterward the Lord appeared to Solomon by night saying He had heard his prayer. The verse shows that public vocal prayer was practiced in Israel.

The verse means that Israelites carried as captives into exile could return to God with all their heart and soul, confess their sin, and pray from the land of their captivity toward their ancestral land, Jerusalem, and the temple built for His name, with distance from the temple not preventing them from seeking God. For such prayer Solomon asks God to hear from heaven, uphold their cause, and forgive their sin. The prayer teaches that God is not confined to the temple, since He meets His people by His Spirit when they gather there and visits and encourages them wherever they are, so His children may worship Him in every place.