set serveroutput on declare x number; y number; t varchar(10); begin x:=5; y:=x*x; select nazwisko into t from osoby where id_os=3; update zatrudnienia set pensja=pensja*1.1; dbms_output.put_line(t||' '||' '||x||' '||y); dbms_output.put_line(SQL%ROWCOUNT); end; declare cursor kr is select nazwisko from osoby; type tr is record ( t varchar(20) ); dane tr; begin open kr; loop fetch kr into dane; exit when kr%notfound; dbms_output.put_line(dane.t); end loop; close kr; end; set serveroutput on declare cursor kr is select nazwisko from osoby; type tr is record ( t varchar(20) ); dane tr; begin for dane in kr loop dbms_output.put_line(dane.nazwisko); end loop; end; / show error; create or replace function f(x in number, y in out number) return number is w number; begin y:=x*y; w:=x*x; return w; end; set serveroutput on declare w number; z number; begin w:=5; z:=f(3,w); dbms_output.put_line(z); dbms_output.put_line(w); end; select * from user_procedures; create sequence licz increment by 1 start with 60; create or replace trigger tr1 before insert on wydzialy for each row declare x number; begin :new.nazwa:=initcap(:NEW.nazwa); select licz.nextval into :new:id_w from dual; end;
Zachariasz