1
votes

I've created an "instead of" trigger for a simple view that only does select * on a table and a trigger that does nothing (I wanted to minimize the problem):

create or replace view tmp(id, nazwa, nip, adres, zalega, punkty) as
select * from klient

create or replace trigger tmp_trg
instead of insert
on tmp
for each row
begin

end;

The view is created. Then when I want do declare this trigger sql developer returns error:

Error(8,1): PLS-00103: Encountered the symbol "END" 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' << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe

2
Note: if you just want to stop people inserting into your view, just revoke the INSERT privileges from the view.Jeffrey Kemp

2 Answers

5
votes

just add "null;" between the begin and the end.

1
votes

a trigger that does nothing (I wanted to minimize the problem):

I'm not sure I understand why you need a trigger if it does nothing ?

To answer, there isn't a valid PL/SQL statement in your trigger code block, add a NULL to make it a valid block and have no action.

create or replace trigger tmp_trg
instead of insert
on tmp
for each row
begin
NULL;
end;