triggers

drupal actions triggers rules

Hi, I'm looking at the code in the signup module. It seems that there are triggers and actions in place already for certain events. If I was to add rules events, would that confuse the situation? Or is it possible to use the triggers to call rules actions? I would like to add rules events and rules schedule to it. Thanks Ed ...

Using Aggregate Functions Inside a Trigger In MySQL

I have a 'People' table with several attributes including 'age'. Each time I insert a new tuple into this table, I would like to find out the average age of all the people listed in the table. If the average is above 50, I want to modify the age in the tuple being inserted. I'm using a 'BEFORE INSERT' trigger for this. Here is the test c...

Restoring two databases to precisely the same time

In SQL Server 2008, I have my parent table in one database, and the child table in another database, with FK relationship maintained by triggers. I cannot change it, cannot move both tables into one DB and have a regular FK constraint. When I restored both databases from full backups, I had orphans in my child table, because the full bac...

Triggers in oracle

What are the condtions where triggers can enhance or hinder the performance? When to use and when not to use the triggers in the system? How triggers can be used to impose complex constraints? ...

SQL Server CLR Trigger with SMO or Linq?

Hello, I've been looking at the possibility of creating a CLR trigger for insert, but every tutorial found gives me examples of using ado.net objects to do the logic - this is not very convenient way..(I don't think I have to convince anyone about that) I was wondering if maybe there is another way for doing this? SMO? Linq? Anything e...

Getting table name in a trigger in MySQL

Hi guys, is it possible to get table name in a MySQL trigger ? i use trigger to log insert actions on some tables in MySQl and i need the name of the table where the trigger is placed at. Thanx before :) ...

How can I set a property of a DropShadowEffect via a Trigger in a ControlTemplate?

I have a Button ControlTemplate and I'm trying to modify a DropShadowEffect on a Border by using a Trigger. Here is my Xaml: <Button.Template> <ControlTemplate TargetType="Button"> <Border x:Name="ButtonBorder" Margin="10" CornerRadius="5" Background="Gray"> <Border.Effect> <DropShadowEffect ShadowDepth="5" x:Name="B...

MySQL BEFORE INSERT Trigger Select Into Multiple Variables?

I'm trying to write a trigger in MySQL and I need to set the values of several variables. The values I need to put into these variables are from a row in an existing table (not worried about multiple rows, there will only be one): DELIMITER | CREATE TRIGGER ins_move_to_hist BEFORE INSERT ON EndOfDay FOR EACH ROW BEGIN DECLARE _RowsMa...

SQL Server Trigger switching Insert,Delete,Update

Hello is possible to switch between DML commands/operations (Insert,Delete,Update) on Trigger Body?, I try to snippet some T-SQL for understand me better : CREATE TRIGGER DML_ON_TABLEA ON TABLEA AFTER INSERT,DELETE,UPDATE AS BEGIN SET NOCOUNT ON; CASE WHEN (INSERT) THEN -- INSERT ON AUX TABLEB WHEN (DELE...

Trigger thickbox from flash

hello guys! i wonder if somebody knows how to trigger thickbox from onRelease() event in flash. is that possible? ...

Wpf ListBox Trigger not working for IsFocused Property.

I want to style my ListBox and displaying some Border around it, i want to hide this Border when ListBox gets focus, <Trigger Property="IsFocused" Value="True"> <Setter Property="Visibility" TargetName="border" Value="Collapsed"/> </Trigger> Same thing i m using in TextBox also and it is working properly, why this Trigger not workin...

PostgreSQL triggers and exceptions

I'm trying to get my first ever trigger and function to work, but how I throw exceptions and return data right way? PostgreSQL 8.4.1 CREATE TABLE "SHIFTS" ( id integer NOT NULL, -- SERIAL added timestamp without time zone DEFAULT now() NOT NULL, starts timestamp without time zone NOT NULL, ends timestamp without time zo...

Use mysql user in trigger

I'm creating a trigger in MySQL to let me know WHO (which mysql user) is doing an update on a specific table. I know MySQL has a function CURRENT_USER(), but is that going to insert the username at the time the trigger is CREATED, or at the time the trigger is CALLED? This is my trigger so far. I want to insert the username in the 'con...

SQL Server delete trigger - row handle referred to a deleted row or a row marked for deletion

I have a delete trigger on a table which is used to delete entries from a table in an another database. CREATE TRIGGER [dbo].[Trigger_Contracts_Delete] ON [dbo].[Contracts] AFTER DELETE NOT FOR REPLICATION AS IF @@ROWCOUNT = 0 RETURN DELETE seconddb.dbo.second_table WHERE contractId IN (SELECT d.ContractID FROM deleted d) Whe...

Need help with simple mysql triggers

Hi, I have one table (TABLE A) in my mysql database which has the listed fields: row1_id - PK row2_id - PK row3_data What I would like to do is, every time a record is inserted or updated in table A, I would like to call a trigger to write me the new information of table A in another table, TABLE A_LOG, which has the following field...

Style triggers in Silverlight

Hi, I am trying to use style triggers in silverlight like so: <Path Canvas.Top="20" Stroke="#FF808080" Data="M 0,20 20,0 40,20 Z" StrokeLineJoin="Round"> <Path.Style> <Style TargetType="{x:Type Path}"> <Setter Property="Fill" Value="DarkGray"/> <Style.Triggers> ...

SQL Trigger 1 row at a time

I'm creating an update trigger that goes like this (SQL Server 2005): Is the state column of the row is 23 or 25 don't update it. Else update it. It's very simple. I'm trying OldState = (Select State from Deleted) If OldState in (25,23) Update it --how to do it easily? else dont do nothing for this row The problem is that the ...

SQL Server: Self-reference FK, trigger instead of ON DELETE CASCADE

Hello, I need to perform an ON DELETE CASCADE on my table named CATEGORY, which has the following columls CAT_ID (BIGINT) NAME (VARCHAR) PARENT_CAT_ID (BIGINT) PARENT_CAT_ID is a FK on CAT_ID. Obviously, the lovely SQL Server does not let me use ON DELETE CASCADE claiming circular or multiple paths to deletion. A solution that I see o...

SQL Server - Size Based Trigger

Is there a way to have a trigger fire when a table hits a specified size? I am doubtful, but I thought I would ask. It would be useful for logging tables that I want to keep under a specific size. (I would delete older entries when the trigger fired.) ...

Constraints instead Triggers (Specific question)

I read here some reasons to use constraints instead of triggers. But I have a doubt. How can be assure (using only constraints), the coherence between SUPERCLASS tables and SUBCLASSES tables? Whit a trigger is only a matter of check when INS.. UPD... Is there a way to define that kinda relation by using only constraints (I'm newbie at ...