Hey guys,
I'm pretty new to MySQL. I have my database and a web form that will let users enter data into the tables. I would like to create a trigger that will update a field in the row with a preset URL, plus a value from another field in the row whenever they add a new row or update one. The script I have so far is this:
USE mcsicweb;
CREATE TRIGGER add_bigchart_url BEFORE INSERT ON stockanalysis
FOR EACH ROW BEGIN
IF (NEW.bigcharturl IS NULL) THEN
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;
However, I keep getting syntax errors. Can someone help me with this?
Thanks!