ITPub博客

首页 > Linux操作系统 > Linux操作系统 > t_c_b_s之存储过程写法小记

t_c_b_s之存储过程写法小记

原创 Linux操作系统 作者:wisdomone1 时间:2011-07-20 17:23:04 0 删除 编辑
采用plsql特殊类型及参数游标来操作数据如下:lvnLoopCtr := 1;

 OPEN curs_GetFundInfo(lvnAcctNbr, lvnRTXNNbr);--参数游标

 LOOP

  FETCH curs_GetFundInfo
  INTO lvsFundTypCd,
    lvsFundTypDtlCd,
    lvsClearCatCd,
    lvnSeqNbr,
    lvnNbrOfItems,
    lvnAmt;
  EXIT WHEN curs_GetFundInfo%NOTFOUND;

  lvasFundTypCd(lvnLoopCtr) := lvsFundTypCd; --plsql记录类型
  lvasFundTypDtlCd(lvnLoopCtr) := lvsFundTypDtlCd;
  lvasClearCatCd(lvnLoopCtr) := lvsClearCatCd;
  lvanSeqNbr(lvnLoopCtr) := lvnSeqNbr;
  lvanNbrOfItems(lvnLoopCtr) := lvnNbrOfItems;
  lvanFundsAmt(lvnLoopCtr) := lvnAmt;

  lvnFundTypArraySize := lvnLoopCtr;

  lvnLoopCtr := lvnLoopCtr + 1;

 END LOOP;

 CLOSE curs_GetFundInfo;rtxnrptgrprtxntyp表为何义?receipt收据;查看存储过程PROC_ED_CALCDEPOSITACCRUEDINT;intraterecalcmeth表是利息利率重新计算方法表;混合利率及复合利率;ratechangemeth利率变化方法表,On Cycle及Calendar Period;利率改变方法;LEAP YEAR;

查看此存储过程PACK_NEWDISB;
SELECT A.MjAcctTypCd,
             A.CurrMiAcctTypCd,
             A.DateLastMaint,
             A.CurrAcctStatCd,
             A.NextSubNbr,
             A.CurrAcctStatCd,
             B.AccrThruDueDateYN,
             C.BillAdvanceYN,
             B.PmtCalcIncludeOddDaysYN,
             C.Date1stPmtDue,
             B.OddDaysMethCd,
             --          B.PassbookLoanYN, C.RevolveLoanYN, C.LoanLimitYN
             B.PassbookLoanYN,
             C.RevolveLoanYN,
             C.LoanLimitYN,
             B.RnewAllowedYN,
             A.ContractDate --Modified By RSI on 07-20-2005 for Issue# 0069-346
        INTO lvsMjAcctTypCd,
             lvsMiAcctTypCd,
             lvdtAcctDateLastMaint,
             lvsAcctStatCd,
             lvnNextSubAcctNbr,
             lvsCurrAcctStatCd,
             lvsAccrThruDueDateYN,
             lvsBillAdvanceYN,
             lvsPmtCalcIncludeOddDaysYN,
             lvdFirstDueDate,
             lvsOddDaysMethCd,
             --        lvsPassBookLoanYN, lvsRevolveLoanYN, lvsLoanLimitYN
             lvsPassBookLoanYN,
             lvsRevolveLoanYN,
             lvsLoanLimitYN,
             lvsRnewAllowedYN,
             lvdContractDate --Modified By RSI on 07-20-2005 for Issue# 0069-346
        FROM Acct A, MjMiAcctTyp B, AcctLoan C
       WHERE A.AcctNbr = in_ACCTNBR
         AND B.MjAcctTypCd = A.MjAcctTypCd
         AND B.MiAcctTypCd = A.CurrMiAcctTypCd
         AND C.AcctNbr = A.AcctNbr
         FOR UPDATE;--排它赋值 select into for update



此种写法;lvbIntExists := (lvnExistsCount > 0);--变量的赋值为一个表达式,此表达式的结果为布尔值false or true




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-702678/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 收据__小记
请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12006734