- create or replace procedure pp(in_num number,out_num out number) as
- total1 number:=0;
- total2 number:=0;
- begin
- select sum(s.totalmoney) into total1 from salerecord s where s.customerid = in_num;
- select sum(s.totalmoney) into total2 from salerecord s;
- out_num := round((total1/total2*100),2);
- dbms_output.put_line('地区编号为'||in_num||'的地区的销售额占总销售的百分之:'||out_num);
- end;
复制代码 编译成功后,然后使用- declare
- t_t number;
- begin
- -- Call the procedure
- pp(2,t_t);
- dbms_output.put_line(t_t);
- end;
复制代码 测试时却总提示
ora-01036 非法的变量名/编号
,请各位同学指点.
|
|