db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: using SELECT as an SQL triggered action
Date Tue, 12 Feb 2008 09:13:37 GMT
musky wrote:
> i will make my aim more clearer here:
> i have created an AFTER insert trigger on a table called chattable which has
> two fields(ID INT,Message VARCHAR(255)).here is the trigger:
> "CREATE TRIGGER insert_trigger AFTER INSERT ON chattable REFERENCING
> NEW_TABLE AS chattableupdate FOR EACH STATEMENT SELECT * FROM
> chattableupdate"
> where chattableupdate is a transition table.
> 
> i want the transition table to contain the newly inserted rows whenever an
> insert takes place into chattable.
> 
> please help me,because with this trigger,when i select * from
> chattableupdate and assign it to a resultset i get an error that the
> "chattable view/table does not exist"

I do not think doing a select in a trigger does not make sense.  JDBC 
does not provide you with any way to get hold of the result set.
 From your description, I think you need an insert statement in your 
trigger, not a select statement.

-- 
Øystein

Mime
View raw message