Question: I need to loop over about 10 strings, which are all known to me in advance -- I don't need to `SELECT` them from anywhere.

I attempted:

```sql
BEGIN
    FOR tab IN ('one', 'two', 'three')
    LOOP
        EXECUTE IMMEDIATE 'DROP TABLE ' || tab;
    END LOOP;
END;

```

But that does not work (`LOOP` is unexpected)...

Is there a way to do this?

Answer: 
```sql
declare
   type t_strings is table of varchar2(100);
   strings t_strings:=t_strings('one','two','three');
begin
   for i in 1..strings.count loop
      dbms_output.put_line(strings(i));
   end loop;
end;
/

```

Results:

```
one
two
three

```

Or you can use your own short-cut functions:
<http://orasql.org/2017/10/02/plsql-functions-iterate-and-keys-for-associative-arrays/>

Btw, Oracle 21 has some new features for FOR-LOOP:

* [1.1.1 PL/SQL Extended Iterators](https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/release-changes.html#GUID-60026B49-A592-4F2A-83FC-5C755695F850)
* [FOR LOOP Iteration Enhancements in Oracle Database 21c](https://oracle-base.com/articles/21c/for-loop-iteration-enhancements-21c)

So it can be rewritten as:

```sql
declare
   type t_strings is table of varchar2(100);
begin
   for str in values of t_strings('one','two','three') loop
      dbms_output.put_line(str);
   end loop;
end;
/

```
```
begin
for tab_rec in (  select 'abc' val from dual
            union 
            select '123' val from dual )
loop
 EXECUTE IMMEDIATE 'DROP TABLE ' || tab_rec.val;
end loop;
end;

```