解决方案 »
- 求高手帮忙算一组数据
- PL/SQL下为何看不到clob大对象里的数据
- 请指点一下SQL中检索是否存在记录
- 动态行转列的代码 编译不过,大家帮帮我啊,着急!
- select语句中where判断条件中varchar2和to_char()的比较
- 小弟求一条sql语句,有分贡上。。。。。。。。。
- 有哪条语句可以查到库中的表名呀
- 谁用过oracle workflow 呀,能不能介绍一下,推荐几个网站或介绍几本书也行
- 一直报不是group by 表达式。。求解
- 请教各位大佬执行插入语句时,如何生成 001 001001 001002 002 002001 002002这种编号,非常感谢!
- 删除表时,表上的约束没跟着被删除?
- oracle10G的文本数据导入速度怎么才能和SQL的DTS一样?
create or replace procedure serch_sum (sumb11 out number,ddate String)
is
begin
select sum(combank) from bank into sumb11
where com=101 and ddate between to_date(ddate||' 00:00:00','yyyy-mm-dd') and to_date(ddate||' 23:00:00','yyyy-mm-dd');
end;set serveroutput on;
declare
sumb11 number(10) := 0;
begin
serch_sum(sumb11, 'aaa');
dbms_output.put_line(sumb11); --输出结果
end;
from bank
where com=101 and
ddate between to_date(ddate || ' 00:00:00','yyyy-mm-dd') and to_date(ddate || ' 23:00:00','yyyy-mm-dd')
begin
select sum(combank)
into sumb11
from bank
where com = 101
and ddate between to_date(ddate + ' 00:00:00', 'yyyy-mm-dd') and
to_date(ddate + ' 23:00:00', 'yyyy-mm-dd');
end;
SQL> create or replace procedure pro_out_test(i_empno in emp.empno%type,o_sal out emp.sal%type) is
2 begin
3 select sum(sal)
4 into o_sal --把结果赋值给o_sal
5 from emp
6 where empno = i_empno;
7 exception when no_data_found then
8 dbms_output.put_line('没有员工号'||i_empno||'信息');
9 end;
10 /
Procedure created
SQL> set serveroutput on;
SQL> declare
2 v_sal emp.sal%type;
3 v_empno emp.empno%type;
4 begin
5 v_empno := 7369;
6 pro_out_test(v_empno,v_sal); --调用pro_out_test过程
7 dbms_output.put_line('员工号'||v_empno||'的薪水为'||v_sal);
8 end;
9 /
员工号7369的薪水为800
PL/SQL procedure successfully completed