How to concatenate table name with variable within for loop in sql
I am trying to write a one time (as in never to be run again) script to
collect information about usage of certain features of our product. Here
is a simplified script that I have right now:
begin
for db in (select owner from dba_tables where
table_name='feature_table') loop
begin
for info in (select * from db.owner.feature_table where
something='important') loop
begin
dbms_output.put_line(db.owner||' , '||info.type||' ,
'||info.source);
end;
end loop;
end;
end loop;
end;
I get an error in the inner loop at "db.owner.feature_table". I also tried
passing it as concatenated string, but to no avail. What do I need to do
to get this to work?
No comments:
Post a Comment