Skip to content

Instantly share code, notes, and snippets.

@mattmusc
Created October 24, 2019 13:35
Show Gist options
  • Select an option

  • Save mattmusc/fe7ff8b236f1402c6cdbf250d7f6a421 to your computer and use it in GitHub Desktop.

Select an option

Save mattmusc/fe7ff8b236f1402c6cdbf250d7f6a421 to your computer and use it in GitHub Desktop.
PL/SQL: Execute a statement for all tables starting with 'Prefix'
BEGIN
FOR c IN ( select owner as schema_name, table_name from sys.all_tables where table_name like '--PREFIX--' )
LOOP
EXECUTE IMMEDIATE ' SELECT * FROM ' || c.table_name;
END LOOP;
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment