日期:2014-05-16 浏览次数:20395 次
create or replace procedure out_line is begin dbms_output.put_line(systimestamp); dbms_output.put_line('helloWorld'); end; / set Serveroutput on ; exec out_line ;
??
?
create or replace procedure demo2(dno number ,dname varchar2 ,loc varchar2) is begin insert into dept values(dno ,dname ,loc); end; / exec demo2(70,'gouchao','gouchao'); commit; select * from dept;
?
?
create or replace procedure demo3(eno number , name out varchar2 ,salary out number) is begin select ename ,sal into name,salary from emp where empno = eno; exception when no_data_found then dbms_output.put_line('该记录不存在'); end; / set serveroutput on ; var name varchar2(10); var salary number; exec demo3(7788,:name ,:salary); print name salary ;
??
?
?
create or replace procedure demo4(i number , j number , sum out number) is begin sum:= i+j; end; / var result number; exec demo4(1,2,:result); print result;
?
?