For Each Loop PL/SQL
I am slowly learning PL/SQL, I have some programming experience using Visual Basic for Excel, so I am not totally in the dark, but not really sure :-)
Here is what I am trying to do, am on 10g by the way.
I have about 10+ Tables in my schema, with pretty much the same structure and I know that I could use plain SQL to do this with, but I want to learn PL/SQL.
So, I have 10+ tables where I have to add a new field of type varchar2(100), I was wondering if I could employ the FOR LOOP or maybe something better, list all the Tables that I need to ALTER and say:
For each Table from list
LOOP
alter table table_name add KEY varchar2(100);
END LOOP;
I have the full list of the Tables, what do you guys think ?