Started 4 days, 16 hours ago (2009-12-03 23:32:00)
by Rick James
What version of mysql?
What I get:
mysql> set @test:=1;
mysql> select @test;
+-------+
| @test |
+-------+
| 1 |
+-------+
Started 1 week, 4 days ago (2009-11-27 10:48:00)
by Peter Brawley
If `36_currency` tracks the MySQL username, the trigger can match it to USER(), otherwise modify that table to track it along with logon timestamps.
PB
http://www.artfulsoftware.com
Edited 2 time(s). Last edit at 11/27/2009 01:56PM by
Peter Brawley.
Started 2 weeks ago (2009-11-24 11:09:00)
by Peter Brawley
DECLARE must
precede all other code in a routine, or in a block within a routine. If a trigger generator is writing this trigger, fix the generator.
PB
http://www.artfulsoftware.com
Started 2 weeks ago (2009-11-24 11:06:00)
by Peter Brawley
No triggers on Views in MySQL. Write the trigger on the underlying table.
PB
http://www.artfulsoftware.com
Started 2 weeks, 1 day ago (2009-11-23 10:48:00)
by Peter Brawley
Dan,
I see three problems.
1. No delimiter command, eg ...
DROP TRIGGER IF EXISTS tr_fixtimes;
DELIMITER go
CREATE TRIGGER tr_fixtimes BEFORE INSERT ON ewise_slice
FOR EACH ROW BEGIN
Declare NewTime
TIMESTAMP;
Declare GoodTime DATETIME;
-- other code here ...
END;
go
DELIMITER ;
2. The query ...
SELECT TIMESTAMPDIFF(SECOND,MAX(ewise_slice.slice_timesta mp),MAX(...
Started 2 weeks, 2 days ago (2009-11-21 19:01:00)
by Peter Brawley
I think there's an example like that in the
manual page on Triggers.
PB
http://www.artfulsoftware.com
Started 2 weeks, 2 days ago (2009-11-21 17:08:00)
by Jason Mooney
I have resolved the issue I was having. I needed to reference the NEW. for the items I was working with.
DELIMITER //
CREATE TRIGGER `virtualtcats`.`after_joborder` AFTER UPDATE ON `virtualtcats`.`joborder`
FOR EACH ROW BEGIN
UPDATE
virtualtjoomla.jos_jl_jobposting
SET
virtualtjoomla.jos_jl_jobposting.title = NEW.title,
virtualtjoomla.jos_jl_jobposting.jobtype...
Started 3 weeks, 3 days ago (2009-11-13 22:28:00)
by Peter Brawley
You forgot DELIMITER?
PB
http://www.artfulsoftware.com
Started 2 weeks, 4 days ago (2009-11-19 23:08:00)
by Peter Brawley
Not doable.
By its nature, a Trigger is specific to one table and one table only, so if your trigger doesn't know what table it's servicing, something is wrong.
PB
http://www.artfulsoftware.com
Started 2 weeks, 5 days ago (2009-11-19 10:52:00)
by Peter Brawley
Paolo,
NEW isn't a general row identifier; it's just a syntactic convenience for referring to particular columns in row being manipulated by a Trigger.
Unfortunately PREPARE isn't allowed in triggers & functions. This is one reason MySQL triggers aren't well suited to implementing audit trails. You might want to have a look at the articles titled "
Transaction time validity..." in http...