此示例的主要目的主要是为了了解在PL/SQL环境下怎么创建和执行存储过程. 存储过程所涉及的DataTable: 第一步:创建游标变量 游标是ORACLE系统在内存中开辟的一个工作区,主要用来存储SELECT的数据的.通俗的讲就是用来存储查询数据的一个临时的变量. 游标的创建: CREATE OR REPLACE PACKAGE pkg_query AS TYPE cur_query IS REF CURSOR; END pkg_query; 第二步:存储过程的创建 create or repl…
一.创建存储过程 1.存储过程写法 create or replace procedure HVM_BYQ_TJ --变压器统计信息--->入库 (id in number) as begin .. loop then ) ; end if; then ) ; end if; end loop; end HVM_BYQ_TJ; 2.调用 call HVM_BYQ_TJ(1); 二.触发器调用存储过程 1.创建触发器 create or replace trigger HVM_ZTPJ_BYQ…
在oracle的存储过程中,不能直接使用DDL语句,比方create.alter.drop.truncate等. 那假设我们想在存储过程中建立一张暂时表就仅仅能使用动态sql语句了: create or replace procedure pro as str_sql varchar2(100); begin -- 创建暂时表 str_sql := 'create global temporary table temp_table ( col1 varchar2(10), col2 number…
创建存储过程: 格式:create or replace procedure procedure_name(参数 参数类型) Is/as 变量1 变量1的类型: begin ----------业务逻辑---------- end: -- plsql里面调用存储过程 begin ); end; --创建存储过程 create procedure proc(dno number) is cursor c is select * from emp where deptno = dno; begin…