Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers and ESQL

Re: Triggers and ESQL

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Sun, 28 Nov 1999 16:40:30 +0100
Message-ID: <943803711.6036.0.pluto.d4ee154e@news.demon.nl>


Normally in PL/SQL, SQL*PLus such a block is concluded with / on a separate line.
This trigger wouldn't work anyhow, as you need to use direct assignment (:new.floor = 3 + 1), you are not allowed to UPDATE a table which is already mutating.

Hth,

--
Sybrand Bakker, Oracle DBA
martinl <laflamme_at_iname.com> wrote in message news:ZNb04.24$pe5.3113_at_weber.videotron.net...
> Greetings to all,
>
> I'm trying to use triggers with ESQL and I have a small problem: it
> doesn't work. In order to trace down the problem, I've simplified my
> trigger definition as much as I could and I ended up with the following
> dumb-looking function:
>
> void createTriggers()
> {
> EXEC SQL CREATE TRIGGER give_bonus
> AFTER UPDATE OF desk ON offices
> FOR EACH ROW WHEN capacity > 1000
> BEGIN
> UPDATE offices SET floor = 3 + 1;
> END;
> }
>
> Unfortunately for me, even this very simple function doesn't work.
The
> precompiler always gives me this error:
>
> PCC-S-02022, Found end of file while scanning a SQL statement
>
> I was wondering if there is anything I need to declare in the DECLARE
> SECTION, or anywhere else for that matter, whenever I use triggers with
> ESQL. Since I haven't, maybe that is why the precompiler always complains.
> Anybody has a clue about why it doesn't work?
>
> Thanks for any help,
> Martin
>
>
Received on Sun Nov 28 1999 - 09:40:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US