i've had a look on the forum but at the moment theres no answer to this question. Basically i'm trying to create a view inside my procedure as its easier than a complicated select statement that doesnt seem to be working because its returning 'ORA-01422 exact fetch returns more than requested number of rows'.I've put the statement at the bottom for reference
However the view option doesnt seem to be working its return another error 'Encountered the symbol "CREATE" when expecting one of the following:'. Is there something i'm doing wrong?
Thanks for having a look.
procedure proRekt (par_id number) is
vardec farm.parcel.description%type;
vland farm.landuse.landuse_id%type;
v_luse farm.landuse.landuse%type;
varpl farm.parcel.parcel_id%type;
begin
create or replace view Door as
select a.parcel_id,a.description,b.landuse_id,c.landuse
from
farm.parcel a,
farm.parcel_landuse b,
farm.landuse c
where a.parcel_id = b.parcel_id
and b.landuse_id = c.landuse_id;
select parcel_id,description,landuse
into varpl,
vardec,
vland
from door
where parcel_id = parID;
**** faulty select statement
select a.parcel_id,c.description,a.landuse_id,b.landuse
into varpl,
vardec,
vland,
v_luse
from farm.parcel_landuse a,
farm.landuse b,
farm.parcel c
where c.parcel_id = parID
and a.landuse_id = b.landuse_id
and a.parcel_id = c.parcel_id;