C#调用存储过程,存数据到oracle数据库,怎么实现把多行数据循环插入到数据库中。
createorreplaceprocedureKAP_FK_WRBUDGET(pnovarchar2,p_desvarchar2,p_budgetnovarchar2,...
create or replace procedure KAP_FK_WRBUDGET(pno varchar2,p_des varchar2,p_budgetno varchar2,p_amount number) is
org_id number;
budgetfail_flag varchar2(100);
BEGIN
-- bal:=get_budget_balnew(P_budgetno);
select o.org_id into org_id
from mipeng_bz_org o
where o.org_no=substr(p_budgetno,4,1);
/* if bal<p_amount then
-- if bal_row.curbal < 0 then
budgetfail_flag:=p_budgetno||''||'该预算编号预算余额不够!';
-- exit;
ELSE*/
INSERT INTO MIPENG_BUDGET_PAY (ID,BUDGET_PAY_DEPT,BUDGET_PAY_BUDGETNUM,BUDGET_PAY_DATE,BUDGET_PAY_TOTAL,BUDGET_PAY_TYPE,BUDGET_PAY_TYPEDES,BUDGET_PAY_CONTRACTNUM,BUDGET_PAY_ORG,BUDGET_PAY_TRANS,BUDGET_PAY_TRANSDES,CREATED_BY,CREATION_DATE,BUDGET_PAY_DES)
VALUES (MIPENG.mipeng_budgettotal_s.nextval,SUBSTR(P_BUDGETNO,11,6),P_BUDGETNO,SYSDATE,P_AMOUNT,0,'费 用','F'||''||Pno,org_id,'1','已审核',fnd_global.user_id(),sysdate,p_des);
commit;
end KAP_FK_WRBUDGET; 展开
org_id number;
budgetfail_flag varchar2(100);
BEGIN
-- bal:=get_budget_balnew(P_budgetno);
select o.org_id into org_id
from mipeng_bz_org o
where o.org_no=substr(p_budgetno,4,1);
/* if bal<p_amount then
-- if bal_row.curbal < 0 then
budgetfail_flag:=p_budgetno||''||'该预算编号预算余额不够!';
-- exit;
ELSE*/
INSERT INTO MIPENG_BUDGET_PAY (ID,BUDGET_PAY_DEPT,BUDGET_PAY_BUDGETNUM,BUDGET_PAY_DATE,BUDGET_PAY_TOTAL,BUDGET_PAY_TYPE,BUDGET_PAY_TYPEDES,BUDGET_PAY_CONTRACTNUM,BUDGET_PAY_ORG,BUDGET_PAY_TRANS,BUDGET_PAY_TRANSDES,CREATED_BY,CREATION_DATE,BUDGET_PAY_DES)
VALUES (MIPENG.mipeng_budgettotal_s.nextval,SUBSTR(P_BUDGETNO,11,6),P_BUDGETNO,SYSDATE,P_AMOUNT,0,'费 用','F'||''||Pno,org_id,'1','已审核',fnd_global.user_id(),sysdate,p_des);
commit;
end KAP_FK_WRBUDGET; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |