Re: PL/SQL Triggers.

From: <morleb_at_cbr.hhcs.gov.au>
Date: 30 Jan 95 13:19:53 +1000
Message-ID: <1995Jan30.131953.1_at_cbr.hhcs.gov.au>


In article <D2MFG2.ALE_at_mail.auburn.edu>, vasudevy_at_eng.auburn.edu (Vasudev V. Yendapally) writes:
> This is what I get when I try to run a trigger.
> Could someone tell me what's actually going wrong ?
>
> /*****************************************************************/
> This is my trigger
> /*****************************************************************/
> CREATE trigger my_trigger
> BEFORE INSERT ON my_table
> BEGIN
> UPDATE my_table
> SET c=sysdate
> WHERE c IS NULL;
>
> END;
> /
> /*******************************************************************/
>
> This is what I get
> /*************************************/
>
> SQL>start my_trigger.sql
> CREATE trigger my_trigger
> *
> ERROR at line 1:
> ORA-00901: invalid CREATE command
>
>
> unknown command "END" - rest of line ignored.
> CREATE trigger my_trigger
> *
> ERROR at line 1:
> ORA-00901: invalid CREATE command
>
>
> /*************************************************************************/

Try placing the following statement immediately before the "create trigger" statement:

SET SQLTERMINATOR OFF There seems to be a bug in SQL*Plus when processing "create trigger" statements. Sometimes a ";" in the body of a trigger is interpreted as a terminator for a SQL command.

Hope this helps.



Brian Morley morleb_at_cbr.hhcs.gov.au Dept Human Service & Health, Brisbane, Australia Received on Mon Jan 30 1995 - 04:19:53 CET

Original text of this message