Toad for Oracle..How to execute multiple statements?

user1191463 picture user1191463 · Feb 7, 2012 · Viewed 115.2k times · Source

I have some 800-1200 INSERT statements generated from an excel sheet. I want to run these in TOAD - Oracle db.

If I press F9, it runs only one line and F5 gives me syntax issue and do not seem to work? What am I missing here?

Answer

John Doyle picture John Doyle · Feb 7, 2012

F9 executes only one statement. By default Toad will try to execute the statement wherever your cursor is or treat all the highlighted text as a statement and try to execute that. A ; is not necessary in this case.

F5 is "Execute as Script" which means that Toad will take either the complete highlighted text (or everything in your editor if nothing is highlighted) containing more than one statement and execute it like it was a script in SQL*Plus. So, in this case every statement must be followed by a ; and sometimes (in PL/SQL cases) ended with a /.