Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I terminate a trigger declaration in an SQL file?
DDL Statements are implicitly Committed and hence do not need an explicit COMMIT.
Further, it is not advisable to 'Commit' within a Trigger.
You should have appended a '/' after the end; statement instead of the 'commit'
-Thiru
kev wrote:
> The subject says it really.
>
> If I have a section of code in a .sql file, for example:
>
> --start code----------
> create or replace trigger trig1
> before insert on webtab1
> for each row
> begin
> select seq1.nextval
> into :new.id
> from dual;
> end;
>
> commit;
> --end code------------
>
> then I run the code in svrmgrl:
>
> SVRMGR> @create_demo.sql
>
> I get this error:
>
> MGR-00072: Warning: TRIGGER TRIG1 created with compilation errors.
>
> Then if I do a 'show errors' I get:
>
> Errors for TRIGGER TRIG1:
> LINE/COL ERROR
> --------------------------------------------------------------------------------5/1
> PLS-00103: Encountered the symbol "COMMIT"
>
> So, how do I terminate the create trigger function?
>
> Thanks,
>
> - Kev
Received on Tue Aug 03 1999 - 14:09:58 CDT