Is it possible to do this query with a loop, or a list, to get the results for several indexes? Thank you.
select ctx_report.create_index_script('LISTOFINDEXES') from dual;
You could pass a list of index names with a collection:
select ctx_report.create_index_script(column_value)
from table(sys.odcivarchar2list('INDEX_1', 'INDEX_2'));
Or you could base it on the data dictionary:
select ctx_report.create_index_script(index_name)
from user_indexes
where ...
or perhaps more usefully:
select ctx_report.create_index_script(idx_name)
from ctx_user_indexes;