Site icon Tour Feeds

Having problems with this select in Oracle PLSQL

I have this code:

create view nombres_lab as
    select L.NOMBRE_LAB, R.NOM_REG, count(*) as vacunas_suministradas
    from LABORATORIOS L
    inner join CREA_VACUNAS CV on l.cod_lab = cv.cod_lab
    inner join vacunas V on cv.cod_vac = v.cod_vac
    inner join vtorio VT on v.cod_vac = vt.cod_vac
    inner join datos_vac_sum DVS on vt.cod_vtorio = dvs.cod_vtorio
    inner join frasco_vac FV on dvs.s_unica = fv.s_unica
    inner join direccion D on vt.cod_dir = d.cod_dir
    inner join region R on d.cod_reg = r.cod_reg
    where v.cod_vac = 100202 or v.cod_vac = 100303
    group by l.nombre_lab, r.nom_reg;


create or replace procedure ranking is

    
begin
    
    
    select nombre_lab, nom_reg, count(*) as vacunas_suministradas, rank() over(order by count(*) desc) as ranking from nombres_lab group by nom_reg, nombre_lab;
    

end;

I’ve been trying to convert this select to an select into so that it can work inside the procedure, but nothing that i try works.

Error:  PLS-00428: an INTO clause is expected in this SELECT statement

I know its weird to do just a select in the procedure and nothing more, but i want to know if its possible

Exit mobile version