How can I do a delete for a table in a stored procedure before inserting data into the table?
create or replace procedure proc_test is
begin
delete * from table1
insert into table1
select * from table2
end proc_test;
Does does not seem to work, what is wrong with the syntax? The error is
ERROR at line 8: 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
<< close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
6. select * from table1
7.
8. end proc_test;
Ah, the problem was with the missing semicolons! This works