Re: Trigger to Combine Elements of Other Row Data?
There is no syntax errors and I have created this trigger successfully, without any errors.
What error do you have?
One thing, trigger is a source object, BEGIN..END clause contains of code. To avoid problems with source code and object definitions, special statement delimiters should be used, which are different from semicolon. For example -
DELIMITER $$
CREATE TRIGGER add_bigchart_url
BEFORE INSERT ON stockanalysis
FOR EACH ROW
BEGIN
IF NEW.bigcharturl IS NULL THEN
SET NEW.bigcharturl = CONCAT('http://bigcharts.marketwatch.com/charts/big.chart?symb=';, NEW.ticker, '&compidx=aaaaa:0&ma=3&maval=50,,200&uf=0&lf=1&lf2=0&lf3=0&type=2&size=2&state=8&sid=2773712&style=320&time=8&freq=1&comp=NO_SYMBOL_CHOSEN&nosettings=1&rand=9193&mocktick=1');
END IF;
END$$
DELIMITER ;
Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/
Subject
Views
Written By
Posted
3180
February 25, 2011 07:51AM
1250
February 25, 2011 08:38AM
1109
February 25, 2011 09:23AM
1021
March 01, 2011 01:15AM
1149
March 01, 2011 01:54PM
Re: Trigger to Combine Elements of Other Row Data?
1454
March 02, 2011 12:37AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.