Thread: triggers in SQL?

triggers in SQL?

From
Neil Conway
Date:
I want to write a simple trigger in SQL (i.e. use the trigger to execute
a simple function written in SQL). I'm having difficulty - CREATE TRIGGER
complains if the return type of the procedure is not 'OPAQUE', but CREATE
FUNCTION won't allow me to create SQL functions with a return type of
OPAQUE.

Am I going about this the wrong way? I want to update some data
automatically when new rows are inserted into table A. Should I use a
TRIGGER AFTER INSERT on table A, or is there a better way? The data
that needs to be updated is fairly simple (actually, just 1 or 2
UPDATE queries), which is why I would prefer not to have to load PL/SQL
or write the function in C.

Thanks, and sorry for my newbie-ness.

Neil

--
Neil Conway <neilconway@home.com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

Whoever you are -- SGI, SCO, HP, or even Microsoft -- most of the smart people
on the planet work somewhere else.
        -- Eric S. Raymond

Attachment

Re: triggers in SQL?

From
Neil Conway
Date:
On Sun, Sep 10, 2000 at 02:36:39PM -0400, Neil Conway wrote:
> I want to write a simple trigger in SQL (i.e. use the trigger to execute
> a simple function written in SQL). I'm having difficulty - CREATE TRIGGER
> complains if the return type of the procedure is not 'OPAQUE', but CREATE
> FUNCTION won't allow me to create SQL functions with a return type of
> OPAQUE.
>
> Am I going about this the wrong way?

Woops. 5 minutes after posting this I realized that rules would probably
be a better choice.

Unless anyone else has any input, sorry to bug everyone.

Neil

--
Neil Conway <neilconway@home.com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

It is dangerous to be right when the government is wrong.
        -- Voltaire

Attachment