create or replace package body pkg_tobacco
is
procedure pro_tobacco1(tostart in date,toend in date,p_toba out p_cursor)
is
v_sql varchar2(2000);
begin
v_sql:='select x.cname,x.fname,sum(profit) from
(select s.custid as cid,c.custname as cname,f.factname as fname,(lsprice-pfprice)*s.salenum as profit from
sale s,customer c,tobacco t,factory f
where s.custid=c.custid and s.tobaid=t.tobaid and t.factid=f.factid and s.saldate between '||tostart||' and '||toend||') x
group by x.fname,x.cname';
open p_toba for v_sql;
end pro_tobacco1;
end pkg_tobacco;这个在java中调用后总提示java.sql.SQLSyntaxErrorException: ORA-00905: 缺失关键字
ORA-06512: 在 "SCOTT.PKG_TOBACCO", line 12,求助。
is
procedure pro_tobacco1(tostart in date,toend in date,p_toba out p_cursor)
is
v_sql varchar2(2000);
begin
v_sql:='select x.cname,x.fname,sum(profit) from
(select s.custid as cid,c.custname as cname,f.factname as fname,(lsprice-pfprice)*s.salenum as profit from
sale s,customer c,tobacco t,factory f
where s.custid=c.custid and s.tobaid=t.tobaid and t.factid=f.factid and s.saldate between '||tostart||' and '||toend||') x
group by x.fname,x.cname';
open p_toba for v_sql;
end pro_tobacco1;
end pkg_tobacco;这个在java中调用后总提示java.sql.SQLSyntaxErrorException: ORA-00905: 缺失关键字
ORA-06512: 在 "SCOTT.PKG_TOBACCO", line 12,求助。
type p_cursor ref cursor;
楼主是要做什么? 打开之后也没有关闭?
type p_cursor is ref cursor;