Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set serveroutput on
- declare
- type my_col is varray(100) of number;
- v_vect my_col :=my_col();
- type tip_meu is record(
- nr_com comenzi.nr_comanda%type,
- val rand_comenzi.pret%type,
- dat date);
- type index_tb_meu is table of tip_meu index by pls_integer;
- colectie_inreg index_tb_meu;
- begin
- null;
- for i in 1..5 loop
- v_vect.extend;
- v_vect(i):=i+1998;
- end loop;
- for i in v_vect.first..v_vect.last loop
- dbms_output.put_line(v_vect(i));
- select c.nr_comanda,sum(rc.pret*rc.cantitate) as valoare,c.data bulk collect into colectie_inreg from comenzi c, rand_comenzi rc
- where c.nr_comanda =rc.nr_comanda and extract (year from c.data) = v_vect(i)
- group by c.nr_comanda,c.data;
- if sql%notfound then dbms_output.put_line('Nu exista comenzi in anul '||v_vect(i));
- else
- for j in 1..colectie_inreg.count loop
- null;
- dbms_output.put_line(colectie_inreg(j).nr_com||' '||colectie_inreg(j).val);
- end loop;
- end if;
- end loop;
- end;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement