triggers

MySQL DELIMITER syntax errors

This MySQL script installs multiple triggers. It works on one machine running MySQL 5.0.51b-community. On another machine running MySQL 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) it fails, with this error message, which seems to be related to the DELIMITER // ... // DELIMITER; syntax : ERROR 1064 (42000) at line 272: You ha...

What's the best way to create a single field in the table is designed to keep the computation of a different table fields

i want to save a balance of user, in the user table . the balance calculate from other table rows, is trigger on the other table is the best way ? or do it in script languages like php ? It is important that to be accurate, and performance. thanks ...

ORACLE Rollback and Trigger

Does the after Update trigger will kick off if there is a rollback? Scenario: Lets say we update a table A and the trigger on table A kicks off and updates another table B with the details. If there is a rollback issued on table A due to some processing error, will the trigger cause the table B to rollback the change? ...

Access 2007 triggers and procedures equivalents?

Ok, does anyone have some good resources for Access 2007 features regarding triggers or stored procedures? Can it even do them or something similar to them? Every resource I have found on Microsoft’s help is referencing back to Access 2003, as well as many of the help manuals online. Everything is moved around in 2007, so it is a littl...

"Schema changed after the target table was created. Rerun the Select Into query.":

I have some code that disables a trigger on a table, runs an update, and reenables the trigger. It doesn't drop the source table or update the schema. This would all be fine, but at the same time there are separate queries running that use that table as the source for a SELECT INTO. For some reason, when the two queries are running at t...

How can I set a username for a Postgresql audit trigger?

I am using a trigger in PostgreSQL 8.2 to audit changes to a table: CREATE OR REPLACE FUNCTION update_issue_history() RETURNS trigger as $trig$ BEGIN INSERT INTO issue_history (username, issueid) VALUES ('fixed-username', OLD.issueid); RETURN NULL; END; $trig$ LANGUAGE plpgsql; CREATE TRIGGER update_issue...

Can I pass arguments to an external (CLR) SQL Server trigger?

I have a trigger in SQL Server, but I need to pass arguments to the CLR code, i.e., information not provided in the trigger context. Is something like this even possible? CREATE TRIGGER MyTrigger ON MyTable FOR INSERT AS EXTERNAL NAME MyAssembly.MyNamespace.MyTriggerHandler("Foo", "Bar") These arguments would be static, of course. ...

How can I make WPF Trigger for IsMouseOver on TreeViewItem NOT affect all parents of the moused-over control?

I understand why this is happening. The bounding box of a parent TreeViewItem includes its children's bounding boxes, so when I am moused over a TreeViewItem, all its parents in the tree are also moused over. Is there something besides IsMouseOver I should be using? ...

WPF Trigger to change Cursor

I need to change the cursor of a TreeViewItem in a trigger. This code works for all other properties but not Cursor: <Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="QuickPhrases:TreeViewChecker.IsMouseDirectlyOverItem" Value="True"> </Condition> <Condi...

MySQL set current date in a DATETIME field on insert

I have a 'created_date' DATETIME field which I would like to be populated with the current date upon insert. What syntax should I use for the trigger for this? This is what I have so far but it is incorrect. CREATE TRIGGER set_created_date BEFORE INSERT ON product FOR EACH ROW BEGIN SET NEW.created_date = now(); ...

Linux Process Spawn/Creation Trigger

Hello, I am attempting to programmatically track the processes a linux user is currently running. Is it possible to be notified when a user has fork-ed or exec-ed a new process, or is the only solution to perpetually poll the process list for new processes. Thanks, Ken ...

MySQL runtime-generated view

On redesigning a MySQL database I came up with an idea: creating a VIEW which can be altered when a TRIGGER (on UPDATE of other table) runs, using information selected from the INFORMATION_SCHEMA database. Hence we could have a view of whichever columns might be necessary at runtime. Since ALTER TABLE is illegal inside triggers, the set...

Is it possible to change properties on a sub item in a DataTemplate using triggers from the containing control?

I want to change the background colour of the rectangle in the IsMouseOver trigger, is this possible? <Window> <Window.Resources> <DataTemplate x:Key="StackListViewItemTemplate"> <Grid> <Rectangle RadiusX="5" RadiusY="5" > <Rectangle.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0...

Is there anyway to be able to reference xml/text columns in the "inserted" and "deleted" tables in a SQL Server 2008 (CLR) trigger?

I get an exception when I "Select * from deleted" in a clr trigger in SQL Server 2008. Is there anyway to be able to access xml/text columns from the deleted and inserted tables in a trigger? ...

Can I use a Trigger in this scenario?

Hi folks, I have a table (ie. ReportData) which contains some calculated data -> eg. classroom average scores, number of students, avg grade point, etc. etc. lots of report like data. Works great. Now, in some of my other tables (eg. the ClassRoom table) if i change some data in there, I need to update the ReportData table. So I thou...

WPF TextBox Text multiple triggers

Hi! I'm doing a list of contacts for a person. I have an ItemsControl which uses DataTemplates for different types of contact information. E.g. Phone number, Email... etc In case of phone number, I want user to have 4 TextBoxes where he can edit the number. 4 because of the format (he can edit numbers only, the format is generated aut...

How To Forward Data To An External System If There Were Changes During An INSERT or UPDATE? Use a Trigger? Use Extended Sproc or CLR Integration?

Here's the basics of the system we have in place today. We have a SQL 2005/2008 table defined as: CREATE TABLE [dbo].[Profiles] ( [Firm] [char] (4) NULL , [Account] [char] (10) NOT NULL , [UndSym] [char] (24) NOT NULL , [Updated] [timestamp] NOT NULL , [Data] [image] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] ...

SQL Server 2005 How can I set up an audit table that records the column name updated?

given this table definition create table herb.app (appId int identity primary key , application varchar(15) unique , customerName varchar(35),LoanProtectionInsurance bit , State varchar(3),Address varchar(50),LoanAmt money ,addedBy varchar(7) not null,AddedDt smalldatetime default getdate()) I believe changes will be minimal, usu...

WPF - How to make Style.Triggers trigger a different named style to be applied

Hi guys Lets say I have the below: <Style TargetType="{x:Type TextBox}"> <Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderBrush" Value="Gray" /> <Style.Triggers> <Trigger Property="IsFocused" Value="true"> <Setter Property="BorderBrush" Value="Green" /> <Setter Proper...

WPF- Animate from one style to another

Hi guys Just wondering if anyone know how to animate from one style to another i.e. going from NormalStyle to ActiveStyle when the user focuses on the textbox <Style x:key="NormalStyle" TargetType="{x:Type TextBox}"> <Setter Property="BorderBrush" Value="Gray" /> <Setter Property="BorderThickness" Value="2" /> </Style> <Style...