- /*
- 创建存储过程
-
- create or replace procedure proc_name as
- begin
- do something;
- end proc_name;
- */
-
- create or replace procedure updateA as
- begin
- update A set ename="DOG";
- commit;
- end updateA;
-
- --测试
-
- begin
- updateA;
- end;
- select * from A;
-
-
- /*创建带有输入参数的存储过程*/
-
- create or replace procedure myproc(p_name varchar2
- ,p_job varchar2
- ,p_mgr number
- ,p_hiredate date
- ,p_sal number
- ,p_com number
- ,p_deptno number
- ,out_count out number)
- as
- begin
- declare v_count integer;
- begin
- select count(*) into v_count from emp;
- dbms_output.put_line(v_count);
- insert into emp values(v_count+1,p_name,p_job,p_mgr,p_hiredate,p_sal,p_com,p_deptno);
- select count(*) into out_count from emp;
- end;
- end myproc;
- --测试
- declare v_out_count number;
- begin
- myproc("AAc","CLERK",1,to_date("2011-09-12","yyyy-MM-dd"),1,1,20,v_out_count);
- end;
Oracle 学习笔记之包的使用crontab调用shell访问Oracle问题相关资讯 Oracle教程
- Oracle中纯数字的varchar2类型和 (07/29/2015 07:20:43)
- Oracle教程:Oracle中查看DBLink密 (07/29/2015 07:16:55)
- [Oracle] SQL*Loader 详细使用教程 (08/11/2013 21:30:36)
| - Oracle教程:Oracle中kill死锁进程 (07/29/2015 07:18:28)
- Oracle教程:ORA-25153 临时表空间 (07/29/2015 07:13:37)
- Oracle教程之管理安全和资源 (04/08/2013 11:39:32)
|
本文评论 查看全部评论 (0)