Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PASSING MULTIPLE VALUES AS IN PARAMETER TO STORED PROCEDURE

Mohd SalmanJun 30 2017 — edited Jun 30 2017

Hi Team,

I have created below procedure in which i am passing values as in parameter and then the in parameter is used in my where clause in select query.

I call the procedure by single value as input parameter.Now i want to pass multiple values as IN parameter to the same procedure.

Procedure Code :-----

CREATE OR REPLACE PROCEDURE test_procedure(lp_id in number) AS

begin

  

insert intoTABLE_C(ID)

select ID from TABLE_A

where ID=lp_id

and  ID not in(select ID from TABLE_B

where ID=lp_id

);

commit;

END test_procedure;

Calling Procedure :----

begin

test_procedure(100);

end;

Requirement :---

Now my select query should be using IN clasue as

select ID from TABLE_A

where ID in (lp_id)

and  ID not in(select ID from TABLE_B

where ID in (lp_id)

and assuming the procedure to call values as arrays like

begin

test_procedure(100,200,300);

end;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2017
Added on Jun 30 2017
2 comments
2,057 views