As I discuss in this question, by far the most popular school of Hindu philosophy is the Vedanta school, which bases its tenets on the doctrines laid out in the Brahma Sutras, a work by the sage Vyasa that summarizes and systematizes the philosophical teachings of the Upanishads. (You can read the Brahma Sutras here.) But the Vedanta school didn't always have the dominant position in Hindu philosophy; before the time of Adi Shankaracharya the dominant school of Hindu philosophy was the Purva Mimamsa school, which I discuss here. In contrast to the Vedanta school which is devoted to analyzing the Jnana Kanda of the Vedas, i.e. the Upanishads, Purva Mimamsa focuses on analyzing the Karma Kanda of the Vedas, i.e. the Samhitas and Brahmanas.
Now the Purva Mimamsa school was agnostic on whether there was an actual world called Swarga which souls can go to when they die. But they did believe that when the Vedas say that performing a certain Yagna leads to Swarga, that's a promise of happiness for the soul in the afterlife, whether that happiness involves going to an actual world or not. But in this excerpt from Shabara's commentary on the Purva Mimamsa Sutras, the defining text of the Purva Mimamsa school, Shabara discusses the question of whether Yagnas that promise a result other than Swarga, like obtaining a son or acquiring cattle, also bear fruit in the afterlife, or whether they can bear fruit in this life itself. A hypothetical opponent argues that all Yagnas only bear fruit in the afterlife, not in this life:
[W]hen we are told that a certain sacrifice brings cattle to the performer, it should be understood to mean that as a result of the performance of that sacrifice, the performer obtains (in his next life) such a special kind of Body and Sense-organs and the rest as enables him to acquire cattle. That this is so is clearly indicated in the following passage - "Kaikaya, being desirous of performing a sacrifice, said to Dalbhya: - 'Please help me perform this sacrifice, which is calculated to bring me a kingdom.':- Dalbhya replied:- 'Do not, my boy, think that the sacrifice brings kingdom in this life. In fact, sacrifices are performed for results to come in one's next life.'" Here it is clearly shown that the results of sacrifices appear in another life.
Shabara responds to this by arguing that Dalbhya is merely telling Kaikeya that the specific Yagna he'll perform for Kaikeya will yield results in the afterlife rather than in this life, not that it's impossible to perform a Yagna that will yield results in this life. For the record, Shabara's interpretation of the passage seems a bit tenuous to me.
But my question is, where is the scriptural passage about Kaikaya and Dalbhya from? Based on the subject matter I assume it's from one of the Brahmanas of the Vedas, although it could be from the Aranyakas or Upanishads.
Google searching the names Kaikaya and Dabhya doesn't seem to turn up anything other than references to Shabara's commentary, so perhaps this is from a lost Shakha of the Vedas. (See my answer here for more information on Vedic Shakhas.)