When I run the following it executes just fine
WITH temp AS ( SELECT owner, table_name FROM all_tables )
SELECT * FROM temp;
When I then add a BEGIN-END block it does not work anymore
BEGIN
WITH temp AS ( SELECT owner, table_name FROM all_tables )
SELECT * FROM temp;
END;
The error message is:
an INTO clause is expected in this SELECT statement
Can anyone explain what is going on here and why the WITH statement needs to be amended?