Re: how to use plsql to calculate compond growth

From: nullpointer <null_pointer_at_rediffmail.com>
Date: 28 Dec 2003 23:47:26 -0800
Message-ID: <c0728f9d.0312282347.59b6f551_at_posting.google.com>


PL SQL autobinds so no need to specify those as bind variables This should work

   1 declare
   2 money number :=50000.00;
   3 year number :=1;
   4 begin for i in 1..17
   5 loop insert into my_401k values(year, money + 0.1*money);    6 year := year +1;
   7 end loop;
   8* end;

Hope it Helps
nullpointer


ning_1898_at_yahoo.com (David) wrote in message news:<37032184.0312281959.286e42ef_at_posting.google.com>...
> Hi Jim,
>
> Thank you for your help. I still got the same error message based on your code
>
> Any where wrong?
>
> Thanks
>
> David
>
> 1 declare
> 2 money number :=50000.00;
> 3 year number :=1;
> 4 begin for i in 1..17
> 5 loop insert into my_401k values(:year, :money + 0.1*:money);
> 6 year := year +1;
> 7 end loop;
> 8* end;
> nli_at_HOPE1> /
> SP2-0552: Bind variable "MONEY" not declared.
>
>
>
>
> ning_1898_at_yahoo.com (David) wrote in message news:<37032184.0312271915.d9d43ef_at_posting.google.com>...
> > I am learning plsql. I would like to run a stored procedure to
> > calculate my bank account value by predicted 10% annual growth rate.
> > Below is my plsql that is having problems. Your help is highly
> > appreciated.
> >
> > Thanks
> >
> > declare
> > money number := 50000.00;
> > year number := 1;
> > begin for i in 1..17
> > loop
> > execute immediate 'insert into my_401k values (':year', 'money + 0.10
> > * money')';
> > year := year + 1;
> > end loop;
> > end;
> > /
> >
> >
> > SP2-0552: Bind variable "YEAR" not declared.
> >
> > Any where wrong in this script?
> >
> > Thanks
Received on Mon Dec 29 2003 - 08:47:26 CET

Original text of this message