Re: PL/SQL Triggers.

From: Scott Urman <surman_at_oracle.com>
Date: 1 Feb 1995 18:47:32 GMT
Message-ID: <3gol04$dt8_at_dcsun4.us.oracle.com>


You also need to make sure that you are using SQL*Plus 3.1 against Oracle7. SQL*Plus 3.0 was meant for Oracle 6, and it doesn't understand the CREATE TRIGGER statement.

In article <1995Jan30.131953.1_at_cbr.hhcs.gov.au>, morleb_at_cbr.hhcs.gov.au writes:
|> 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 Wed Feb 01 1995 - 19:47:32 CET

Original text of this message