如何使用Forms 6i Oracle中的Cursor从多个表中调用数据

时间:2017-07-05 07:13:55

标签: oracle cursor plsqldeveloper

我有一个正常的代码,直到我在查询中使用嵌套的select语句。当我进入嵌套选择的那一刻,我得到错误时遇到符号SELECT期望....以下是我在表单6i中使用的代码块。

Cursor rec (to_date date) IS

  SELECT e."Deal_No", 
      (Select "DeskName"
       From MM_S_DESK
        Where e."DeskCode" = MM_S_DESK."DeskCode") Facility,
           e."Remarks" Counterparty, 
           m."MaturityDate", 
           m."PriRedem" Principal, 


         (select MAX("INTEREST_RATE")
             from MM_BOR_PLA_PAR d 
              WHERE e."Deal_No" = d."DEAL_NO" 
             and "INTERESTINPUTDATE" <= to_dt)/100 yield,
            (To_Date(m."MaturityDate",'dd/mm/yyyy') - To_date(to_dt,'dd/mm/yyyy')) Days_to_Mat,
    Round(((To_date(m."MaturityDate",'dd/mm/yyyy') - To_date(to_dt,'dd/mm/yyyy'))/365)/ (1+((select MAX("INTEREST_RATE")
 from MM_BOR_PLA_PAR d 
WHERE e."Deal_No" = d."DEAL_NO"
  and "INTERESTINPUTDATE" <= to_dt)/100)),4) MDURATION
    FROM MM_T_BORROWING e,
                MM_T_BORROWING_PM_DETAIL m
     Where e."DeskCode" in ('10','11','12','13')
   and e."Value_Date" <= to_dt 
  and e."Maturity_Date" > to_dt 
   and e."Status" not in ('C', 'D', 'Z', '0','X') 
and e."Deal_No" = m."Deal_No"
 and "PriRedem" > '0' 
 and m."MaturityDate" > to_dt;

任何帮助都将受到高度赞赏。

0 个答案:

没有答案