Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Subject: INSERT .. UPDATE DUPLICATES - no trigger is fired

Subject: INSERT .. UPDATE DUPLICATES - no trigger is fired

2007-08-27       - By Dusan Kolesar

 Back
Hello,
I'm using MaxDb 7.6.00.37 on Linux OS (CentOS).

when I do INSET statement wiht UPDATE DUPLICATES
database engine works incorrectly.
Only when INSERT is performed trigger is fired.
On UPDATE none triger is fired.

Here is an example:
CREATE TABLE "ADMIN"."TB"
(
  "ID"  Integer  DEFAULT SERIAL,
  "TXT"  Varchar (30) ASCII  DEFAULT '',
  PRIMARY KEY ("ID")
)
//
CREATE TABLE "ADMIN"."LOG"
(
  "TXT"  Varchar (30) ASCII  DEFAULT ''
)
//
//
CREATE TRIGGER TB_INSERT FOR TB AFTER INSERT EXECUTE
(
  INSERT ADMIN.LOG SET TXT = 'insert';
)
//
CREATE TRIGGER TB_UPDATE FOR TB AFTER UPDATE EXECUTE
(
  INSERT ADMIN.LOG SET TXT = 'update';
)
//
CREATE TRIGGER TB_DELETE FOR TB AFTER DELETE EXECUTE
(
  INSERT ADMIN.LOG SET TXT = 'delete';
)
//
//
INSERT TB SET ID = 1, TXT = 'Text' UPDATE DUPLICATES
//
INSERT TB SET ID = 1, TXT = 'Text (updated)' UPDATE DUPLICATES
//

after 2nd insert there is only 1 row in the LOG table (with text insert).


Thank you for support.

  Dusan

--
Dusan Kolesar
Helsinska 19
040 13  Kosice
Slovakia
e-mail primary : d.kolesar@(protected)
e-mail alternative : d.kolesar@(protected)
ICQ# : 160507424

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=mysql@(protected)