osfar
osfar

Reputation: 413

how to pass list values to a single param function at oracle sql

I have a query that returns a list of person_id

select person_id from per_all_people_f .

and i have another function that takes person_id as a parameter.

package1.get_person_company(p_person_id)

what i want to do is to get the result as

person_id,get_person_company_result

so the function is invoked with all returned values from the first query. how to achieve that?

Upvotes: 0

Views: 421

Answers (1)

MT0
MT0

Reputation: 167981

Just call the function for each row:

SELECT person_id,
       package1.get_person_company(p_person_id => person_id)
         AS get_person_company_result
FROM   per_all_people_f

Upvotes: 1

Related Questions