I am currently working on developing some SQL scripts in PL/SQL Developer and I am getting an "SQL Command not properly ended" error that I am unsure how to solve.
The code I am using looks something like this
CREATE TABLE temp_table as
SELECT * FROM table_x
INSERT INTO temp_table
SELECT * FROM table_y
If I execute the two pieces (create table and the insert) as separate pieces everything runs fine, i.e. select each code block and execute. However if I try to execute everything, select all code and execute, I get an error saying that "SQL Command not properly ended".
I don't mind dealing with this when I am dealing with very small tables but when I have a significant number of operations I need to execute sequentially and when each operation takes a long time to run I would like to be to execute the code and walk away.
Adding a semicolon raises a new error which is an "invalid character" error.
This is the code that raises the invalid character error.
CREATE TABLE temp_table as
SELECT * FROM table_x where x > 1;
INSERT INTO temp_table
(
SELECT * FROM table_y where x > 1;
)