Passing query result to stored procedure.

All posts relating to Oracle PL/SQL development.

Moderator: Tim...

Posts: 1
Joined: Tue Jan 29, 2013 6:06 am

Passing query result to stored procedure.

Postby Narayanan » Tue Jan 29, 2013 6:18 am


I am using oracle 10g version. Can any one please tell me how to pass the query result to IN clause of oracle stored procedure..?

For Example: I have a Employee table which returns only employee names ( select employeeNames from Emplyoee -> this query returns more than 100 employee names).


In my oracle stored procedure, I want to pass these values to comma seperated string....

I have stored the query result in one variable like employee_query="select employeeNames from Employee". Now my requirement is how to pass this query result as comma seperated strings to IN clause of my stored procedure?

Thanks in Advance.

Posts: 30
Joined: Sat Jan 05, 2013 5:13 am

Re: Passing query result to stored procedure.

Postby venkat » Tue Jan 29, 2013 6:49 am

i hope u can use pl sql collections

Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: Passing query result to stored procedure.

Postby Tim... » Tue Jan 29, 2013 7:10 am


You can turn the results of the query into a comma separated string using string aggregation. ... niques.php

That string can then be passed into the procedure as a regular IN parameter.


Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website:
My blog:

Return to “Oracle SQL and PL/SQL Development”

Who is online

Users browsing this forum: No registered users and 4 guests