• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

PL/SQL not running

Can someone tell me why this piece of code is not running - see the error I received

SQL> begin
  2  for i in 1..10 loop
  3  insert into temptab
  4  select * from all_objects;
  5  delete from temptab;
  6  end loop;
  7  commit;
  8  /
commit;
      *
ERROR at line 7:
ORA-06550: line 7, column 7:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
0
donvike1
Asked:
donvike1
1 Solution
 
slightwv (䄆 Netminder) Commented:
Missing an 'end':

begin
    for i in 1..10 loop
    insert into temptab
    select * from all_objects;
    delete from temptab;
    end loop;
    commit;
end;  
/
0
 
donvike1Author Commented:
Thank you, it worked.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now