Stichwort EXECUTE IMMEDIATE mit SQL Befehl als string in einer Variablen.

Alternativ DECLARE -> PREPARE -> EXECUTE

Gruß
Rolf