Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.oracle    |    Overblown overpriced overengineered SHIT    |    2,288 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 862 of 2,288    |
|    Hans Forbrich to David    |
|    Re: how to use plsql to calculate compon    |
|    29 Dec 03 04:43:50    |
   
   From: forbrich@yahoo.net   
      
   David wrote:   
   >   
   > 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@HOPE1> /   
   > SP2-0552: Bind variable "MONEY" not declared.   
   >   
   > ning_1898@yahoo.com (David) wrote in message news:<37032184.03   
   2271915.d9d43ef@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   
      
   Since this is a PL/SQL variable, does it need to be bound? What happens   
   when you drop the semi-colons?   
      
   What I understand from bind variables is they are used to bind between   
   the host environment (eg C, VB, SQL*Plus) and the SQL & PL/SQL   
   environment. Flames for correction appreciated.   
      
   /Hans   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca