All Forums Database
rajimol 1 post Joined 12/13
01 Dec 2013
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??
 

Raja_KT 1246 posts Joined 07/09
02 Dec 2013

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

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.