Subject | Re: [firebird-support] CASE Statement annidation |
---|---|
Author | Arno Brinkman |
Post date | 2004-06-11T13:23:15Z |
Hi,
yes that is possible.
new.field2#old.field1
# ?
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
> I'm trying to write a trigger that log to a table all user operations.<snip>
>
> So I write someting like this:
> CREATE TRIGGER table1_log FOR table1
> ACTIVE AFTER INSERT OR UPDATE OR DELETE POSITION 0
> but in the (updating) CASE, when I try to insert another CASE IBExpertWhat do you meant with annidate?, but if you meant nested CASE expressions,
> return a precompiler error.
>
> My question is:
>
> It is possible to annidiate CASE statement? If not how can I write my
> trigger to obtain same result?
yes that is possible.
> when (updating) then^^^^^^^^^^^^^^^
> 'UPDATE table1 SET fieldkey='||new.fieldkey
> || case when (new.field1#old.field1) then
> ',field1='||new.field1|| end^^^^^^^^^^^^^^^^
> || case when (new.field2#old.field2) then
> ',field2='||new.field2|| endWhat do you meant with :
new.field2#old.field1
# ?
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info