procedure get_detail_sellinfo(p_businessidlist varchar2,
p_enum_name varchar2,
p_year varchar2,
p_month varchar2,
p_name varchar2,
p_out_detail out p_cursor) is
v_mindate date;
v_maxdate date;
enumno number;
v_sql varchar2(4096);
v_product_type number;
begin
v_mindate := to_date(p_year || '-' || p_month || '-1', 'yyyy-mm-dd');
v_maxdate := to_date(p_year || '-' || to_char(to_number(p_month) + 1) || '-1','yyyy-mm-dd');
select m.serialno
into enumno
from maplayer_enum m
where p_enum_name = m.name;
select t.serialno
into v_product_type
from product_info t
where p_name = t.name;
if enumno = 3 then
v_sql := 'select t.name,s.amount,s.price,sum(s.amount*s.price) from town_count t,sell_info s,sell_business_info r where t.serialno in (' ||
p_businessidlist || ') ' || 'and r.town=t.serialno ' ||
'and s.business_no=r.serialno' || 'and s.product_no=' ||
v_product_type || 'and s.date_time >= ' || v_mindate ||
'and s.date_time < ' || v_maxdate;
open p_out_detail for v_sql;
end if;
end get_detail_sellinfo;错误是:ORA_00933SQL命令未正确结束
p_enum_name varchar2,
p_year varchar2,
p_month varchar2,
p_name varchar2,
p_out_detail out p_cursor) is
v_mindate date;
v_maxdate date;
enumno number;
v_sql varchar2(4096);
v_product_type number;
begin
v_mindate := to_date(p_year || '-' || p_month || '-1', 'yyyy-mm-dd');
v_maxdate := to_date(p_year || '-' || to_char(to_number(p_month) + 1) || '-1','yyyy-mm-dd');
select m.serialno
into enumno
from maplayer_enum m
where p_enum_name = m.name;
select t.serialno
into v_product_type
from product_info t
where p_name = t.name;
if enumno = 3 then
v_sql := 'select t.name,s.amount,s.price,sum(s.amount*s.price) from town_count t,sell_info s,sell_business_info r where t.serialno in (' ||
p_businessidlist || ') ' || 'and r.town=t.serialno ' ||
'and s.business_no=r.serialno' || 'and s.product_no=' ||
v_product_type || 'and s.date_time >= ' || v_mindate ||
'and s.date_time < ' || v_maxdate;
open p_out_detail for v_sql;
end if;
end get_detail_sellinfo;错误是:ORA_00933SQL命令未正确结束
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货