pl/sql stored procedure
Hi, I am trying to pass in multiple parameters in this stored
procedure
This is my code:
SET ECHO ON
SET FEEDBACK ON
SET LINESIZE 100
SET PAGESIZE 200
SET SERVEROUTPUT ON
create or replace procedure partsupplier
(pskey in partsupp.ps_partkey%type,
pname out part.p_name%type,
pssuppkey out partsupp.ps_suppkey%type) is
begin
select p_name into pname
from part join partsupp
on ps_partkey = p_partkey
where ps_partkey = pskey;
select count(ps_suppkey) into pssuppkey
from partsupp
where ps_partkey = pskey;
end;
/
show error
declare
pname varchar(50);
pssuppkey number(5);
begin
partsupplier(59396, pname, pssuppkey);
dbms_output.put_line('part key is: 59396' || ', ' || pname ||
pssuppkey);
--dbms_output.put_line('number of suppliers supplying the part: '
|| pssuppkey);
end;
/
show error
drop procedure partsupplier;
The output that I am trying to get is pname and pssuppkey.
However the error stated 'exact fetch returns more than requested
number of rows'.
May I know how do I amend this?
pl/sql stored procedure Hi, I am trying to pass in multiple parameters in this stored procedure This is my code: SET ECH
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
pl/sql stored procedure Hi, I am trying to pass in multiple parameters in this stored procedure This is my code: SET ECH
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!