小弟是个初学者,对于带有输出参数和输入参数的存储过程不知道如何执行,请各位高手帮我指点一二,例如: create or replace procedure acct_item_p(str_code IN VARCHAR2,is_nbr_acct in varchar2,str_result OUT VARCHAR2) 通过上述语句创建的存储过程acct_item_p该如何赋予参数进行执行呢?
DECLARE in_str_code varchar2; in_is_nbr_acct varchar2; out_str_result VARCHAR2 ; in_str_code:=XXX; in_is_nbr_acct:=XXX; begin execute acct_item_p(in_str_code,in_is_nbr_acct,out_str_result); end
多谢啦, 还是执行不了,我的sql语句是: v_temp_sql:='insert into wzg_acct_item_t select a.serv_id,a.acct_id,a.region_id, a.product_offer_id,a.product_id,min(a.acct_month) min_acct_month, max(a.acct_month) max_acct_month,sum(a.acct_charge) sum_acct_month from wlmq.lmf_acct_item_'||'to_char(sysdate-3,'''||'yyyymmdd)'||'''@ods a,wlmq.serv_t@ods b where a.serv_id=b.serv_id and b.partition_id_region=1010 and b.state='''||'F0A'||''' and b.acc_nbr=str_code group by a.serv_id,a.acct_id,a.region_id,a.product_offer_id,a.product_id';execute immediate v_temp_sql;这个语句是不是有问题
in_str_code varchar2;
in_is_nbr_acct varchar2;
out_str_result VARCHAR2 ;
in_str_code:=XXX;
in_is_nbr_acct:=XXX;
begin
execute acct_item_p(in_str_code,in_is_nbr_acct,out_str_result);
end
还是执行不了,我的sql语句是:
v_temp_sql:='insert into wzg_acct_item_t select a.serv_id,a.acct_id,a.region_id,
a.product_offer_id,a.product_id,min(a.acct_month) min_acct_month,
max(a.acct_month) max_acct_month,sum(a.acct_charge) sum_acct_month
from wlmq.lmf_acct_item_'||'to_char(sysdate-3,'''||'yyyymmdd)'||'''@ods a,wlmq.serv_t@ods b
where a.serv_id=b.serv_id and b.partition_id_region=1010 and b.state='''||'F0A'||''' and b.acc_nbr=str_code
group by a.serv_id,a.acct_id,a.region_id,a.product_offer_id,a.product_id';execute immediate v_temp_sql;这个语句是不是有问题