create or replace prosale(v_year number,v_quarter number) is begin insert into desTab(year,quarter,indents,money) select to_number(to_char(trade_date,'yyyy'),9999),to_number(to_char(trade_date,'Q')) as quarter,count(*) from tab where to_number(to_char(trade_date,'yyyy'),9999)=v_year and quarter=v_quarter; commit; end
create or replace prosale(v_year number,v_quarter number) is begin insert into desTab(year,quarter,indents,money) select to_number(to_char(trade_date,'yyyy'),9999),to_number(to_char(trade_date,'Q')) as quarter,count(*),sum(trade_amount) from tab where to_number(to_char(trade_date,'yyyy'),9999)=v_year and quarter=v_quarter; commit; end
create or replace procedure quraur is cursor_1 CURSOR IS select to_char(o.OrderDate,'q') as quarter , to_char(o.OrderDate,'yyyy') AS year ,sum(s.Price * s.Num * ( 1-s.Disconut ) ) as sale from SaleOrderItem s , Orders o where s.OrderID=o.OrdersID group by to_char(o.OrderDate,'q'), to_char(o.OrderDate,'yyyy'); oq Orders.quarter%type; ye Orders.year%type; sa SaleOrderItem.sale%number; begin open cursor_1; loop fetch cursor_1 into oq,ye,sa; exit when cursor_1%notfound; if cursor_1%found then dbms_output.put_line(oq||' '||ye||' '||sa); end if; end loop; close cursor_1; end; error 3/17 PLS-00103: 出现符号 "IS"在需要下列之一时: := . ( @ % ; not null range default character17/4 PLS-00103: 出现符号 "end-of-file"在需要下列之一时: pragma这个错误是怎么回事啊
create or replace prosale(v_year number,v_quarter number)
is
begin
insert into desTab(year,quarter,indents,money)
select to_number(to_char(trade_date,'yyyy'),9999),to_number(to_char(trade_date,'Q')) as quarter,count(*) from tab where to_number(to_char(trade_date,'yyyy'),9999)=v_year and quarter=v_quarter;
commit;
end
create or replace prosale(v_year number,v_quarter number)
is
begin
insert into desTab(year,quarter,indents,money)
select to_number(to_char(trade_date,'yyyy'),9999),to_number(to_char(trade_date,'Q')) as quarter,count(*),sum(trade_amount) from tab where to_number(to_char(trade_date,'yyyy'),9999)=v_year and quarter=v_quarter;
commit;
end
is
cursor_1 CURSOR IS select to_char(o.OrderDate,'q') as quarter , to_char(o.OrderDate,'yyyy') AS year ,sum(s.Price * s.Num * ( 1-s.Disconut ) ) as sale from SaleOrderItem s , Orders o where s.OrderID=o.OrdersID group by to_char(o.OrderDate,'q'), to_char(o.OrderDate,'yyyy');
oq Orders.quarter%type;
ye Orders.year%type;
sa SaleOrderItem.sale%number;
begin
open cursor_1;
loop
fetch cursor_1 into oq,ye,sa;
exit when cursor_1%notfound;
if cursor_1%found then
dbms_output.put_line(oq||' '||ye||' '||sa);
end if;
end loop;
close cursor_1;
end; error
3/17 PLS-00103: 出现符号 "IS"在需要下列之一时:
:= . ( @ % ;
not null range default character17/4 PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
pragma这个错误是怎么回事啊
http://topic.csdn.net/u/20110927/15/6b3fc3cf-e9a6-4cc2-8e5a-232596f5a38b.html