title: How do I use the For loop in Firebird?
body: <p>Can someone explain to me the syntax of the <code>For</code> loop in Firebird?</p>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>As 
  Declare variable Var1 integer;
  begin
  Insert into table1 
  -- Select query to insert some enteries in table 1 - Done successfully.
  FOR SELECT table1.Column1 from table1 into :Var1 
  Do
  Begin 
  Update tableabc.column1 = (select tablexyz. column1 from tablexyz where tablexyz.ID = :Var1) where tableabc.ID = :Var1 
  End
  </code></pre>
  
  <p>Update : Thanks for giving it a try but i dont see any major difference between the query that i wrote and query included in answers. Although above query runs successfully at my end but when i see data in table there occurs no update.</p>
  
  <p>Actually i was making a v.dumb mistake, i was executing alter stored procedure query - which runs successfully and i was assuming this would make the necessary changes. later i executed the stored procedure and it worked pefectly . Thanks all for sparing your time :) ..</p>