Loops without using procedures

Database

Loops without using procedures

Hi

I have a scenario like we need to  calculate premium amount for a perticular year.




if the year in integer for eg 4        
             
  Year   amt      
             
  1   amt/(1+rt_fct)    
  2   (amt*(1+rt_incr_fct)*1)/(1_rt_fct)^2)
  3   (amt*(1+rt_incr_fct^2)*1)/(1_rt_fct)^3)
  4   (amt*(1+rt_incr_fct^3)*1)/(1_rt_fct)^4)
             
If the year In decimal like 3.8 then      
  Year   amt      
             
  1   amt/(1+rt_fct)    
  2   (amt*(1+rt_incr_fct)*1)/(1_rt_fct)^2)
  3   (amt*(1+rt_incr_fct^2)*1)/(1_rt_fct)^3)
  4  

(amt*(1+rt_incr_fct^3)*.8)/(1_rt_fct)^4)

 Assume amt from one table,Year from another,And the other attributes from one table.the max year in db is 20.I tried with procedures. But its showing an error like no more room in database.is there any other way to do this without using procedures. Can you please help me??

1 REPLY
Enthusiast

Re: Loops without using procedures

Hi,

Can you please post in a proper format? There is a code button next to Paragraph. I think if you put in a format with 1) what you have and 2)what is your expectation , then response is faster.

For now, I can see that you can use a CASE WHEN statement.

Thanks and regards,

Raja