WEB开发网
开发学院数据库Oracle 一个通过Oracle8i存储过程,返回记录集的程序包(存... 阅读

一个通过Oracle8i存储过程,返回记录集的程序包(存储过程)

 2007-05-13 12:30:28 来源:WEB开发网   
核心提示: strSQL:='Insert into TEMPAgtBalance Select null,AGTID,''' || pFSTAGTID ||''',AGTCREDIT,AGTPROFIT ,''' ||
 strSQL:='Insert into TEMPAgtBalance Select null,AGTID,''' || pFSTAGTID ||''',AGTCREDIT,AGTPROFIT ,''' || pAreaCode || ''',''' || pAreaName || ''',0 From SecAgtAccount Where Trim(BOSSAGTID)=''' || pFSTAGTID || '''';
  Execute Immediate strSQL;

--3:更新1级代理的下级别代理商数量

  strSQL:='Select Count(*) From TEMPAgtBalance Where SECAgtID is not null And ParentID=''' || pFSTAGTID || '''';
   --DBMS_OUTPUT.PUT_LINE(strSQL);
   Execute Immediate strSQL Into subAgtNumber;
   --Select Count(*) Into subAgtNumber From TEMPAgtBalance Where SECAgtID is not null And ParentID=pFSTAGTID;
   DBMS_OUTPUT.PUT_LINE(subAgtNumber);
   strSQL:='Update TEMPAgtBalance Set AgtCount=' || subAgtNumber || ' Where SECAgtID is null And FSTAGTID=''' || pFSTAGTID || '''';
   Execute Immediate strSQL;
   --DBMS_OUTPUT.PUT_LINE(strSQL);
   --Update TEMPAgtBalance Set AgtCount=subAgtNumber Where SECAgtID is null And FSTAGTID=pFSTAGTID;
End loop;
   
Close FstCursor;
Open Re_CURSOR For 'Select * From Sms_pay.TEMPAgtBalance';
ret:=0;
return;
Exception
  when others then
  DBMS_OUTPUT.PUT_LINE(SQLERRM);
  ret:=999; 
  return;
  End GetAgtBalance;
 
End ;

上一页  1 2 3 4 5 6 

Tags:一个 通过 Oraclei

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接