I have two tables. MODELS and AUTOMOBILES. And procedure which export all models with name that user inputs and their price(stored in AUTOMOBILES).
create or REPLACE procedure modelzz( VAR_MODEL IN MODELS.NAME_MODEL%TYPE,
VAR_PRICE OUT AUTOMOBILES.A_PRICE%TYPE )
as
begin
SELECT a.A_PRICE
INTO VAR_PRICE
FROM AUTOMOBILES a
join MODELS m
on a.MODELS_ID_MODEL=m.ID_MODEL
where m.NAME_MODEL=VAR_MODEl;
dbms_output.put_line(VAR_MODEL||'''s price is : '||VAR_PRICE);
procedure start:
var v_modelzz varchar2;
exec modelzz('&model_name',:v_modelzz);
The problem is I want to export all records for certain model. Their's more than one, one model can have two or more records.
Here's the error: exact fetch returns more than requested number of rows