Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Problem creating a Trigger

From: anniyan <sriram.s(at)hcl.in>
Date: Thu Sep 06 2007 - 09:00:50 EDT

Hi all,

When I am trying to create a trigger I get an error message which I am unable to comprehend.

create trigger updatepricech
 after insert on tbl_prices for each row BEGIN
  DECLARE closep INTEGER;

select close into closep from temptable where Ticker = new.Ticker; update tbl_prices set PriceCh = (Close - closep) where Ticker = new.Ticker and Trade_date = new.Trade_date;
end;

I get the error :

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

Here line 4 is the declaration part.

Do you need help?X

Can you please let me know what could be wrong in this query?
--

View this message in context: http://www.nabble.com/Problem-creating-a-Trigger-tf4392021.html#a12522149 Sent from the MySQL - General mailing list archive at Nabble.com.

--

MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@pantek.com Received on Thu Sep 6 09:04:39 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:09:06 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library