Re: Trigger Problem
Posted in 1998
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Hi,
First of all it is a bad design to have computed column to be a part of
table. That is like un necessary data, it violates database normalization.
When you need the sum of a+b, you can do so in you select or where clause.
Select (a+b) AS Total from tab1;
In article <6nd4q0$qjd1@cchp4.unican.es>,
"Ileana Soler" <ileana.soler@nuclenor.es> wrote:
>
> A table named "tab1" have the following structure:
> create table tab1 (
> a integer primary key constraint num,
> b integer,
> c integer)> The field named "c" will have the result of a+b.
> I want to fill "c" in a trigger on insert on "tab1", but I can't because
> there are the following rule in Informix: "You cannot reference the
> triggering table in any triggered SQL statement with some exceptions".
> I can fill "c" in a trigger on update, but not on insert (error 747).
> My question is: How can I fullfill calculated fields in tables in Informix
> using triggers or stored procedures calling by triggers?
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum