Re: Assistance with trigger

2019-04-26 Thread Machiel Richards
: Assistance with trigger Hi All I am hoping this email finds all well. I would like to request some assistance with a MySQL trigger please. We need to implement a trigger that will in short terms make a backup of a row before it gets deleted. so we have tableA and TableB (backup table

Assistance with trigger

2019-04-26 Thread Machiel Richards
Hi All I am hoping this email finds all well. I would like to request some assistance with a MySQL trigger please. We need to implement a trigger that will in short terms make a backup of a row before it gets deleted. so we have tableA and TableB (backup table). I added a

Re: Renaming a table that has a trigger, then attempting to drop that trigger results in 'table doesn't exist' error.

2016-01-18 Thread shawn l.green
ment, name varchar(255) )// CREATE TRIGGER TEST_TRIGGER BEFORE INSERT ON Test FOR EACH ROW BEGIN SET NEW.name = CONCAT(NEW.name, '_X'); END// RENAME TABLE Test TO TestRenamed// DROP TRIGGER Test.TEST_TRIGGER// Are there any workarounds for this? Thank you for

Renaming a table that has a trigger, then attempting to drop that trigger results in 'table doesn't exist' error.

2016-01-06 Thread Michael Vaughan
If you execute the script below, you will get the following error: 'Error Code: 1146. Table 'testschema.TestRenamed' doesn't exist" delimiter // CREATE TABLE Test( id int not null primary key auto_increment, name varchar(255) )// CREATE TRIGGER TEST_TRIGGER BEFOR

Edit MySQL Trigger in Workbench problem

2013-07-09 Thread Neil Tompkins
Hi, I've created a Trigger and want to edit it. Using MySQL Workbench, I can Alter the table, and click Triggers and select the trigger action I want to edit (on my local database, MySQL running on same PC) However, if I try the exact same procedure on a Trigger on a remote database, I

Re: Editing existing Trigger MySQL 5.6

2013-05-29 Thread hsv
>>>> 2013/05/29 10:39 +0100, Neil Tompkins >>>> Using Workbench with MySQL 5.6 how do I edit a existing Trigger. Do I need to DROP the Trigger and create a new one ? If that is the case how can you run start command in a live environment ? <<<<<<<&

Editing existing Trigger MySQL 5.6

2013-05-29 Thread Neil Tompkins
Hi, Using Workbench with MySQL 5.6 how do I edit a existing Trigger. Do I need to DROP the Trigger and create a new one ? If that is the case how can you run start command in a live environment ? Thanks Neil

Can not add trigger

2012-11-22 Thread aaronrus
I'm using mysql version 5.1.66 on ubuntu and can not add a trigger any more. When trying to add a trigger In phpmyadmin I get "Your SQL query has been executed successfully" but when I issue the command show triggers; no triggers are listed. Im logged into mysql as root and Im

Re:Cant drop trigger.

2012-02-20 Thread Andrew Moore
Is there white space at the end of the trigger name? A On Feb 20, 2012 10:04 PM, "Brent Clark" wrote: > Hi Guys > > I wonder if someone could urgently help me > > Im trying to drop some triggers. But mysql says the trigger does not exist. > > I ran > > SELE

Re: trick trigger

2012-01-16 Thread Karen Abgarian
>> Physics 302 because a student might want to take both classes. And >>> obviously, they shouldn't schedule Professor Higgenbothom to teach both >>> Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and >>> Friday. >>> >>>

Re: trick trigger

2012-01-16 Thread Claudio Nanni
>> Physics 302 because a student might want to take both classes. And >> obviously, they shouldn't schedule Professor Higgenbothom to teach both >> Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and >> Friday. >> >> The problem isn't

Re: trick trigger

2012-01-11 Thread Shawn Green (MySQL)
t schedule Professor Higgenbothom to teach both Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and Friday. The problem isn't actually writing mysql to select the conflicts. The problem is when and how to run the code. I could put it in a trigger but say someone assigns Dr. Higgy to te

trick trigger

2012-01-11 Thread John G. Heim
212 and Probability 278 at 10:00 AM on Monday, Wednesday, and Friday. The problem isn't actually writing mysql to select the conflicts. The problem is when and how to run the code. I could put it in a trigger but say someone assigns Dr. Higgy to teach Calc 212 at 10 AM MWF. They need to b

Re: Mysql Trigger

2011-07-10 Thread Peter Brawley
On 7/10/2011 3:32 AM, vishesh kumar wrote:Hi Members Whats wrong i am doing in following create trigger statement Create trigger test before insert on user for each row begin set New.host=upper(new.host) end Above statement giving error check sql syntax , please guide me

Re: Mysql Trigger

2011-07-10 Thread vishesh kumar
Thanks for reply , but i want to do only for certain record that i will put using IF On Sun, Jul 10, 2011 at 2:42 PM, Reindl Harald wrote: > > > Am 10.07.2011 10:32, schrieb vishesh kumar: > > Hi Members > > > > Whats wrong i am doing in following create trigger

Re: Mysql Trigger

2011-07-10 Thread Reindl Harald
Am 10.07.2011 10:32, schrieb vishesh kumar: > Hi Members > > Whats wrong i am doing in following create trigger statement > > Create trigger test before insert on user >for each row >begin > set New.host=upper(new.host) >end > > Above

Mysql Trigger

2011-07-10 Thread vishesh kumar
Hi Members Whats wrong i am doing in following create trigger statement Create trigger test before insert on user for each row begin set New.host=upper(new.host) end Above statement giving error check sql syntax , please guide me. I want to put host field value in uppercase in

Re: trigger-dumping

2011-03-11 Thread Peter Brawley
er Windows boxes. PB - On 3/11/2011 10:31 AM, Sándor Halász wrote: 2011/03/10 23:03 -0600, Peter Brawley>>>> On 3/10/2011 8:10 PM, h...@tbbs.net wrote: MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for trigger-dumping; the help that I downloaded for this

Re: trigger-dumping

2011-03-11 Thread S�ndor Hal�sz
>>>> 2011/03/10 23:03 -0600, Peter Brawley >>>> On 3/10/2011 8:10 PM, h...@tbbs.net wrote: >MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for >trigger-dumping; the help that I downloaded for this version says it dumps >triggers--but it d

trigger-dumping

2011-03-10 Thread hsv
MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for trigger-dumping; the help that I downloaded for this version says it dumps triggers--but it does not. Now what? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Trigger?

2010-12-21 Thread Wagner Bianchi
I think if you built a trigger to update value of foo's column after, this trigger will not be compiled cause it will execute two transactions on the same one. Try it... Best regards. -- Wagner Bianchi 2010/12/21 Jerry Schwartz > Aha! That was the clue I needed. Thank you so much. &g

RE: Trigger?

2010-12-21 Thread Jerry Schwartz
Aha! That was the clue I needed. Thank you so much. So, to make sure I understand: A “BEFORE” trigger is executed **between** the time that the record is assembled and the time that the action occurs. That’s why the constraints on the field value were being applied before my trigger was

RE: Trigger?

2010-12-21 Thread Jerry Schwartz
Here's my latest attempt: localhost >CREATE TRIGGER makefoo BEFORE INSERT ON testtrigger -> FOR EACH ROW -> SET NEW.foo = IFNULL(NEW.foo, 'ok') -> | Query OK, 0 rows affected (0.00 sec) As you can see, the trigger syntax is correct; but it doesn't do

Re: Trigger?

2010-12-20 Thread Wagner Bianchi
we create the trigger: mysql> create trigger trg_test -> before insert on testtrigger -> for each row -> begin -> if(NEW.foo IS NULL || NEW.foo = '') then -> set NEW.foo = 'Ok'; -> end if; -> end; -> // Query OK, 0

Re: Trigger?

2010-12-20 Thread Michael Dykman
The expression you supplied looks right enough.. how was it declared? as an on UPDATE/on INSERT trigger or just a single case? - michael dykman On Mon, Dec 20, 2010 at 5:21 PM, Jerry Schwartz wrote: > I've never used a trigger before, and I want to make one that sounds like it >

Trigger?

2010-12-20 Thread Jerry Schwartz
I've never used a trigger before, and I want to make one that sounds like it should be simple. Create Table: CREATE TABLE `testtrigger` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `foo` char(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 H

Re: AFTER Delete Trigger question

2010-06-18 Thread João Cândido de Souza Neto
As far as I know, you can´t change data on the same table in triggers. "Kevin Labecot" escreveu na mensagem news:4d2ce38b-d169-478b-aebf-c19f20dce...@labecot.fr... Hi, Is there a way to update the same table on a delete trigger ? I need to call an UPDATE statement when a del

AFTER Delete Trigger question

2010-06-18 Thread Kevin Labecot
Hi,Is there a way to update the same table on a delete trigger ?I need to call an UPDATE statement when a delete occurs.Best regards -- Kevin Labecot, Innovanticwww.innovantic.frTél. : 05.56.45.60.54

Re: ERROR 1442 (HY000) when delete inside trigger statement

2010-02-19 Thread viraj
> > That is correct. There is as far as I know no way in a MySQL trigger to > neither to do operations on the table the trigger belongs to (obviously > except the row that the trigger is operating on through the NEW variables) > nor reject an insert, update, or delete. > than

Re: ERROR 1442 (HY000) when delete inside trigger statement

2010-02-18 Thread Jesper Wisborg Krogh
--- Original Message --- > From: viraj > To: mysql@lists.mysql.com > Sent: 19/2/10, 05:48:41 > Subject: ERROR 1442 (HY000) when delete > inside trigger statement > issue: ERROR 1442 (HY000): Can't update table 'T1' in stored > function/trigger becau

ERROR 1442 (HY000) when delete inside trigger statement

2010-02-18 Thread viraj
i have two table, T1, T2. and 1 trigger. trigger is before update on T1 and it updates some values in T2. once it's done, the trigger tries to delete the subject row of T1 (delete from T1 where id = new.id) i tried with second trigger on T2 (after/before update) and with a procedure inside

Re: Error in running trigger

2009-12-22 Thread Ananda Kumar
gt; On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan < > jeetendra.ran...@sampatti.com> wrote: > > > Hi, > > > > I have created the below trigger from root user with definer: > > > > CREATE definer=`*root...@`` TRIGGER `CONSUMER_PROFILE_before_delete`

Re: Error in running trigger

2009-12-22 Thread Krishna Chandra Prajapati
Hi Ranjan, User doesn't have sufficient privileges. root access required. Thanks, Krishna On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan < jeetendra.ran...@sampatti.com> wrote: > Hi, > > I have created the below trigger from root user with definer: > > CREATE de

Re: Error in running trigger

2009-12-22 Thread Ananda Kumar
is it root or root1 user. Also is this trigger executed by root user or some other user. On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan < jeetendra.ran...@sampatti.com> wrote: > Hi, > > I have created the below trigger from root user with definer: > > CREATE defin

Error in running trigger

2009-12-22 Thread Jeetendra Ranjan
Hi, I have created the below trigger from root user with definer: CREATE definer=`roo...@`` TRIGGER `CONSUMER_PROFILE_before_delete` BEFORE DELETE ON CONSUMER_PROFILE FOR EACH ROW begin INSERT INTO DELETED_CONSUMER_PROFILE(CONSUMER_ID,CONSUMER_TYPE_ID,ENTERPRISE_URL_ID,CONSUMER_FIRST_NAME

Re: error while creating trigger

2009-12-14 Thread Peter Brawley
Jeetendra, ERROR 1054 (42S22): Unknown column 'CAMPAIGN_ID' in 'OLD' But this column is exist in DELETED_CONSUMER_ACTION_AUDIT table. But does it exist in consumer_profile? PB - Jeetendra Ranjan wrote: Hi, I am getting error while creating a simple trigger my

error while creating trigger

2009-12-14 Thread Jeetendra Ranjan
Hi, I am getting error while creating a simple trigger mysql> CREATE TRIGGER CONSUMER_PROFILE_before_delete BEFORE DELETE ON CONSUMER_PROFILE FOR EACH ROW -> begin -> INSERT INTO DELETED_CONSUMER_PROFILE(CONSUMER_ID,CONSUMER_TYPE_ID,ENTERPRISE_URL_ID,CONSUMER_F

Re: trigger

2009-11-04 Thread Phil
esday, November 04, 2009 2:33 PM > To: 'Phil'; Mysql; 'Stefan Onken' > Subject: RE: trigger > > 1. Triggers must have FOR EACH ROW -- it's described in the manual: > http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html > > So the correct syntax wo

RE: trigger

2009-11-04 Thread Gavin Towey
Oops, one more mistake: NOW()-60*60*24*5 isn't the way to do date math. It should be: NOW() - INTERVAL 5 DAY -Original Message- From: Gavin Towey Sent: Wednesday, November 04, 2009 2:33 PM To: 'Phil'; Mysql; 'Stefan Onken' Subject: RE: trigger 1. Trigge

RE: trigger

2009-11-04 Thread Gavin Towey
1. Triggers must have FOR EACH ROW -- it's described in the manual: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html So the correct syntax would be: CREATE TRIGGER greylist_ins AFTER INSERT on greylist FOR EACH ROW delete from greylist where first_seen < NOW()-60*60*24*5; B

Re: trigger

2009-11-04 Thread Phil
You are missing a BEGIN in the trigger delimiter | CREATE TRIGGER greylist AFTER INSERT on greylist BEGIN delete from greylist where first_seen < NOW()-60*60*24*5; END; | delimiter ; Phil On Wed, Nov 4, 2009 at 2:28 PM, Stefan Onken wrote: > Hello, > > I am new to using triggers

Re: trigger

2009-11-04 Thread Michael Dykman
new to using triggers in mysql. I am using mysql 5.1.37  and would like > to setup a trigger like: > > CREATE TRIGGER greylist AFTER INSERT on greylist > delete from greylist where first_seen < NOW()-60*60*24*5; > END; > > When typing this into mysql I am getting an error. Wh

trigger

2009-11-04 Thread Stefan Onken
Hello, I am new to using triggers in mysql. I am using mysql 5.1.37 and would like to setup a trigger like: CREATE TRIGGER greylist AFTER INSERT on greylist delete from greylist where first_seen < NOW()-60*60*24*5; END; When typing this into mysql I am getting an error. Where is my mist

Re: Error - "Select Column Not Found Within Trigger"

2009-10-17 Thread Dan Saul
Well that is embarasing, thank you, It always ends up being the simple things that get you. On Sat, Oct 17, 2009 at 1:25 PM, Michael Dykman wrote: > It appears to be a simple enough error message. Here is your trigger > you are reffering quite explicitly to credits.enabled: > > &

Re: Error - "Select Column Not Found Within Trigger"

2009-10-17 Thread Michael Dykman
It appears to be a simple enough error message.  Here is your trigger you are reffering quite explicitly to credits.enabled: >  select SUM(credits.amount) into total_credits from credits where > credits.enabled=1 and account=new.account; and this table has no such column defined.  debit

Error - "Select Column Not Found Within Trigger"

2009-10-17 Thread Dan Saul
This is the first time I have attempted to expand beyond basic sql for storing data in a table like structure. So my level of knowledge is "familiar with basic SQL, but lacking in expanded knowledge". I expect my error is a newbie mistake. I have attempted to create a trigger to upda

Re: Another Trigger Question!

2009-07-08 Thread Dan Nelson
In the last episode (Jul 09), Marcel Grandemange said: > Create Trigger hostchange > BEFORE UPDATE ON host > FOR EACH ROW > BEGIN > IF NEW.status != OLD.status THEN > use smsgw; > insert into outbox (number, insertdate, text, phone, dreport) VALUES > ('0836075

Another Trigger Question!

2009-07-08 Thread Marcel Grandemange
Good Day once again. Im needing assistance again with triggers! Create Trigger hostchange BEFORE UPDATE ON host FOR EACH ROW BEGIN IF NEW.status != OLD.status THEN use smsgw; insert into outbox (number, insertdate, text, phone, dreport) VALUES ('0836075144', '&#

Re: Trigger and "Warning: #1265 Data truncated"

2009-06-09 Thread Keith Edmunds
> Curdate() returns a datetime, which you are pushing into a date field. > It is truncating the time part. Just truncate it and you should be > fine :) Hmmm. Not according to http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_curdate or, indeed, experiments: mysql> selec

Re: Trigger and "Warning: #1265 Data truncated"

2009-06-05 Thread Walter Heck - OlinData.com
> When a row is inserted into a table, I want populate a 'date' column with > the date 45 days hence. I've created a trigger: > > CREATE TRIGGER `test`.`setExpiryDate` BEFORE INSERT ON `test`.`mysql_auth` > FOR EACH ROW SET NEW.expires = curdate()+interval 45 day > >

Trigger and "Warning: #1265 Data truncated"

2009-06-05 Thread Keith Edmunds
I'm very new to triggers, so I suspect I've done something naive. When a row is inserted into a table, I want populate a 'date' column with the date 45 days hence. I've created a trigger: CREATE TRIGGER `test`.`setExpiryDate` BEFORE INSERT ON `test`.`mysql_auth` FOR

RE: Trigger working with server 5.0.51 but not 5.0.22

2009-05-13 Thread Rolando Edwards
The DROP TRIGGER command is in the wrong place. You changed the delimiter to $$ but still tried to use the semicolon(;) with DROP TRIGGER. Your code should read like this: DROP TRIGGER IF EXISTS cfe_tg_calcular_consumos; DELIMITER $$ CREATE TRIGGER cfe_tg_calcular_consumos AFTER

Re: Trigger working with server 5.0.51 but not 5.0.22

2009-05-13 Thread Mattia Merzi
2009/5/13 Mauricio Tellez : > Hi, I'm developed a trigger with mysql version 5.0.51(ubuntu), and when I > tried to move this to a production server (version 5.0.22 fedora) I ran into [...] > but mysql say there is an error near EXISTS cfe_tg_calculas_consumos. Of http://dev.mysql.

Trigger working with server 5.0.51 but not 5.0.22

2009-05-13 Thread Mauricio Tellez
Hi, I'm developed a trigger with mysql version 5.0.51(ubuntu), and when I tried to move this to a production server (version 5.0.22 fedora) I ran into 2 problems: 1. I try to install the trigger from a text file, and the first lines were: DELIMITER $$ DROP TRIGGER IF E

Trigger causes error in binlog

2008-12-30 Thread Olaf Stein
Hi all, I am having some issues with my replication setup which I have narrowed down to being a problem on the master, more specifically an issue with the binlog when using a trigger. I have a trigger on one of my tables that archives an entry before deleting it: DELIMITER // CREATE TRIGGER

Re: Trying to Create a Trigger

2008-12-06 Thread Martijn Tonies
Going back to the OP's problem - the original issue I believe was he was using "old" instead of "OLD" (case-sensitive) - now that's sorted, MySQL is complaining about a syntax error toward the end of the function declaration. I'm surprised by the case sensitivity of OLD though, it works fine

Re: Trying to Create a Trigger

2008-12-05 Thread Andy Shellam
I think you are missing the point. Where is 'OLD' or 'old' defined? Before you try to imbed it in a trigger, try the basic query. That seems to be what its complaining about. OLD is a virtual table which is only present in a trigger - it's like a table with the

Re: Trying to Create a Trigger

2008-12-05 Thread Wm Mussatto
On Fri, December 5, 2008 12:14, Martijn Tonies wrote: > Hi, > >>>>> What is the exact error message? >>>> >>>> >>>> Here's the latest query: >>>> >>>> delimiter // >>>> create trigger jobposts

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp

Re: Trying to Create a Trigger

2008-12-05 Thread Peter Brawley
eate table jobposts(adsource_id int,jobpost_id int); create table adsource(adsource_id int); delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = (select count(ad.adsource_id) from adsource ad,

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Andy Shellam wrote: I'm guessing it's the first semi-colon in your IF statement. Does this work...? if @counted >= 1 then SET dummy = 'Cannot delete this record' end if; Just a guess! Andy. That's not it, unfortunately. ERROR: You have an error in your SQL syntax; check the manual th

Re: Trying to Create a Trigger

2008-12-05 Thread Andy Shellam
delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp where ad.adsource_id = jp.adsource_id and OLD.jobpost_id

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Martijn Tonies wrote: Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsour

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Martijn Tonies wrote: What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, job

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Jim Lyons wrote: can you not use referential integrity for this - assuming the tables are or can be made to be innodb? The tables are myISAM. These could be changed to innodb but I want to see if i can get this trigger work. Does the jobposts table have a jobpost_id field, or is it just

Re: Trying to Create a Trigger

2008-12-05 Thread Jim Lyons
is a virtual table that is the same as the table I'm doing > work on. See <http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html>. > What I need to do is check if jobposts record has jobposts.adsource_id > (foreign key) which still exists in adsource table (primary key).

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
I'm trying to create a trigger (5.0.45) and I've read the documentation at mysql.com. I keep getting a syntax error, but can't figure out what the error is. Here's the trigger I'm trying to create: delimiter // create trigger jobposts_control before delete on jo

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
#x27;m doing work on. See <http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html>. What I need to do is check if jobposts record has jobposts.adsource_id (foreign key) which still exists in adsource table (primary key). If adsource record still exists, then do not proceed with del

Re: Trying to Create a Trigger

2008-12-05 Thread David Giragosian
On 12/5/08, Lola J. Lee Beno <[EMAIL PROTECTED]> wrote: > > I'm trying to create a trigger (5.0.45) and I've read the documentation at > mysql.com. I keep getting a syntax error, but can't figure out what the > error is. Here's the trigger I'm trying t

Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
I'm trying to create a trigger (5.0.45) and I've read the documentation at mysql.com. I keep getting a syntax error, but can't figure out what the error is. Here's the trigger I'm trying to create: delimiter // create trigger jobposts_control before delete on jo

how to create a trigger

2008-10-26 Thread Uwe Kiewel
fo a trigger, but I don't know how to difine it. Thanks, Uwe -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJBDhNAAoJEEJXG7BUuynnJscQAMyQlA8Goq4nVK

Re: trigger that calls a webservice??

2008-06-20 Thread Antony T Curtis
On 20 Jun 2008, at 06:43, James wrote: On Fri, June 20, 2008 9:12 am, robert rottermann wrote: Hi there, is it possible to define an update trigger that calls a webservice (or just some external method that would do it). we have a web frontent, that does the indexing of data in its own

Re: trigger that calls a webservice??

2008-06-20 Thread Mark Leith
James wrote: On Fri, June 20, 2008 9:12 am, robert rottermann wrote: Hi there, is it possible to define an update trigger that calls a webservice (or just some external method that would do it). we have a web frontent, that does the indexing of data in its own catalog (zope/plone). so I

Re: trigger that calls a webservice??

2008-06-20 Thread James
On Fri, June 20, 2008 9:12 am, robert rottermann wrote: > Hi there, > is it possible to define an update trigger that calls a webservice (or > just some external method that would do it). > > we have a web frontent, that does the indexing of data in its own catalog > (zope/pl

trigger that calls a webservice??

2008-06-20 Thread robert rottermann
Hi there, is it possible to define an update trigger that calls a webservice (or just some external method that would do it). we have a web frontent, that does the indexing of data in its own catalog (zope/plone). so I would like to be able to "push" an update to the frontend. tha

Re: Trigger problem

2008-05-25 Thread Paul DuBois
On May 15, 2008, at 4:30 AM, rustam ershtukaev wrote: I have been trying to write a trigger in mysql, but can't get it to work. It's really simple,i just need my trigger to add varchar value to a table on insert if postcode = 1000. Where does postcode come from? Your SELECT

Re: Trigger problem

2008-05-15 Thread Rob Wultsch
On Thu, May 15, 2008 at 2:30 AM, rustam ershtukaev <[EMAIL PROTECTED]> wrote: > I have been trying to write a trigger in mysql, but can't get it to > work. It's really simple,i just need my trigger to add varchar value to > a table on insert if postcode = 1000.

Trigger problem

2008-05-15 Thread rustam ershtukaev
I have been trying to write a trigger in mysql, but can't get it to work. It's really simple,i just need my trigger to add varchar value to a table on insert if postcode = 1000. this is how i did it: delimiter | drop trigger testdep| create trigger testdep before insert on de

DISABLE TRIGGER alternative

2008-01-31 Thread Olaf Stein
Hi All, I want to disable a trigger on a table for the statements that run within a stored procedure. As DISABLE TRIGGER is not an option I was wondering if any body has any alternatives/ideas on how to achieve this Thanks Olaf - Confidentiality Notice

RE: trigger question..

2007-12-19 Thread bruce
uldn't be set prior to the row being created... any more pointers/thoughts/... thanks -Original Message- From: joe [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 7:33 PM To: 'bruce'; 'mysql list' Subject: RE: trigger question.. create ta

RE: trigger question..

2007-12-19 Thread joe
create table foo (aa varchar(20), id integer, cc varchar(20)); delimiter | create trigger foo_ins before insert on foo for each row begin set new.aa = concat(new.cc,'-',new.id); end; | delimiter ; insert into foo (cc,id) values ('www',1); select * from foo; -

trigger question..

2007-12-19 Thread bruce
hi. using mysql 5.0.27 and playing with triggers. a simple db: create table foo{ aa varchar (10), bb int auto_increment, cc varchar (10), } innondb i'm trying to figure out how to create a trigger, such that if the user does an insert into foo (cc) value ("www"); the table

RE: before insert trigger

2007-12-14 Thread Rolando Edwards
: Thursday, December 13, 2007 7:09 PM To: mysql@lists.mysql.com Subject: before insert trigger Is it possible for a trigger to test the data to be inserted and if it doesn't meet specific criteria not insert the data at all? I have an application that writes a lot of data to my table. I don&#

before insert trigger

2007-12-13 Thread Ed Reed
Is it possible for a trigger to test the data to be inserted and if it doesn't meet specific criteria not insert the data at all? I have an application that writes a lot of data to my table. I don't have control over this application and it writes a lot more data then I need. So I&

Re: trigger question...

2007-12-11 Thread Martijn Tonies
Hi Bruce, > delimiter | > create trigger mfgtst after insert on masterHostTBL > > for each row begin > set @tmp = 55; > insert into masterTestResultStartTBL > set hostID = NEW.id, > testResultVal = 88;

trigger question...

2007-12-10 Thread bruce
hi... i have the following test sql/schema. i'm trying to create a trigger that would allow an item in tbl2 to be updated, based upon values from the tbl that's being inserted into, and the value in a 2nd tbl.element. the sql/schema: /* test schema for stratalight file project # #

Trigger/Locking question--

2007-11-14 Thread bruce
Hi... I'm trying to get me head around a possible situation involving locks/triggers. Suppose I have two tables: FooTBL CatTBL in FooTBL, I have a trigger that operates such that whenever a new row is added to FooTBL, it's immeadiately copied to CatTBL. I'm trying to understa

trigger/cron process questions...

2007-11-13 Thread bruce
I've come across articles discussing triggers, and I'm wondering if triggers might prove usefful or this issue. Is it possible to have a "periodic" trigger, IE a trigger that gets fired based on time. I could have a cron process that updates a tbl on a periodic basis, and a trigger o

Re: Trigger problem

2007-11-13 Thread Scott
On Thu, 2007-11-08 at 17:56 -0800, Lucky Wijaya wrote: > Yes, the trigger code is works. Many thanks !! > Now I understand the use of delimiter command. Thanks again... =) > > My next question is, do we able to view the triggers that has been created ? > And how ? > > D

Re: Trigger problem

2007-11-08 Thread Lucky Wijaya
Yes, the trigger code is works. Many thanks !! Now I understand the use of delimiter command. Thanks again... =) My next question is, do we able to view the triggers that has been created ? And how ? David Schneider-Joseph <[EMAIL PROTECTED]> wrote: My apologies, try this: >

Re: Trigger problem

2007-11-07 Thread David Schneider-Joseph
My apologies, try this: DELIMITER ;; CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi; END; ;; DELIMITER ; To answer your question: The DELIMITER statement tells MySQL to use a different set of

Re: Trigger problem

2007-11-06 Thread Lucky Wijaya
No, I didn't set the delimiter. But, it still have an error after I set delimiter in my trigger as your example. By the way, what's delimiter mean ? And what it's for ? Thanks to you Mr. David. David Schneider-Joseph <[EMAIL PROTECTED]> wrote: Lucky, Did you make sure

Re: Trigger problem

2007-11-06 Thread David Schneider-Joseph
Lucky, Did you make sure to set your delimiter before and after the CREATE TRIGGER statement? e.g.: DELIMITER ;; CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi; END;; DELIMITER ; On Nov 6

Trigger problem

2007-11-06 Thread Lucky Wijaya
Hi, my name is Lucky from Indonesia. I build an database application using Delphi 7 & MySQL as the RDBMS. Now, I'm having problem in creating trigger in MySQL. Here is the code of the trigger: CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DE

Re: Trigger

2007-10-12 Thread Martijn Tonies
>Mostly because use 2 field to represent the same data is a waste of storage i think. Oh, ok. So you're sending a non-date value and you want to transform it into an actual character presentation of a date value, but making things easier on yourself is a waste of storage. Feel free to continu jum

Re: Trigger

2007-10-12 Thread Patricio A. Bruna
Mostly because use 2 field to represent the same data is a waste of storage i think. - "Martijn Tonies" <[EMAIL PROTECTED]> escribió: > >The aplication which is writing to the database is sending the date > in unix > format. > >I can't no change that, so i suposse using a triger will help. >

Re: Trigger

2007-10-12 Thread Martijn Tonies
>The aplication which is writing to the database is sending the date in unix format. >I can't no change that, so i suposse using a triger will help. > >The application pass the 'xx.xx' value when is inserting to the table. Righto. Well, what does this mean then: >im converting the unixtime to

Re: Trigger

2007-10-12 Thread Patricio A. Bruna
> If you want to store a DATE, send a date! Don't send a "unixtime", or > a > "varchar" in > some format, send a date. > > Why on earth would you go sending a "unixtime" to the server and then > using > a trigger > to convert it into a &

Re: Trigger

2007-10-12 Thread Martijn Tonies
"varchar" in some format, send a date. Why on earth would you go sending a "unixtime" to the server and then using a trigger to convert it into a "real date"?! >im correct? if im, should CAST help me? No, sending the proper value, that's what you should be do

  1   2   3   >