Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getting error while reset sequence value

JKMouryaMar 21 2013 — edited Mar 22 2013
i hve created two table. and a sequence for other table. i want to do that when i insert into a first table, entries of other table should be deleted and sequence value should reset to 1. For that i have executed the following sql code
but getting the error:

create or replace Trigger m_sale_ainsert_trig
after insert on m_sale_bill
for each row
begin
DELETE FROM M_TEMP;
<<COLUMN_SEQUENCES>>
BEGIN
Alter Sequence M_TEMP_SEQ Restart with 1;
END COLUMN_SEQUENCES;
end;
/
Alter Trigger m_sale_ainsert_trig enable;


Warning: execution completed with warning
Trigger m_sale_ainsert_trig Compiled.
Alter Trigger m_sale_ainsert_trig succeeded.
5/4 PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:

( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge

pls rectify it!!!!! what are the mistakes in this code?

Edited by: JKMourya on Mar 21, 2013 10:55 AM
This post has been answered by 998184 on Mar 21 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2013
Added on Mar 21 2013
3 comments
608 views