New topic: Names From Triggers
<http://forums.realsoftware.com/viewtopic.php?t=45619> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message neonash7777 Post subject: Names From TriggersPosted: Tue Oct 16, 2012 3:40 pm Joined: Mon Nov 29, 2010 7:01 pm Posts: 282 I have Merchant's that can have any number of Services. I want to create triggers so that when a Service is edited its name changes. CREATE TRIGGER UpdateServiceName BEFORE UPDATE ON `Services` FOR EACH ROW BEGIN SET NEW.`Name` = CONCAT(NEW.`Type`,' ',(Select m.`Name` From `Merchants` WHERE m.`Id`=NEW.`MerchantId`)); END; This doesnt work. Any ideas? It seems I can't get any triggers to work with BEGIN and END in them. If I only have one command and don't use this I can... -----EDIT Apparently I have to do this: DELIMITER $$ ... END$$ I can use anything besides $$, but why I have to do this is stupid and beyond me... Top npalardy Post subject: Re: Names From TriggersPosted: Tue Oct 16, 2012 6:55 pm Real Software Engineer Joined: Sat Dec 24, 2005 8:18 pm Posts: 7489 Location: Canada, Alberta, Near Red Deer Why are you needing to update the name at all ? _________________ My web site Great White Software RBLibrary.com REALbasic learning Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
