MySQL Forums
Forum List  »  Triggers

Re: Using Sequel Pro and keep getting syntax errors for my trigger...
Posted by: Jim Reamer
Date: December 20, 2017 07:42AM

The error:
The following query has failed: "CREATE TRIGGER `WP_tag` AFTER INSERT ON `a_players` FOR EACH ROW For each row Begin Insert into `wp_terms` set `name` = concat(NEW.nameFirst,' ',NEW.nameLast); End;"

MySQL said: #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 'For each row Begin Insert into `wp_terms` set `name` = concat(NEW.nameFirs' at line 1



The show creates:

CREATE TABLE IF NOT EXISTS `a_players` (
`id` int(11) unsigned NOT NULL,
`rankClass` int(2) DEFAULT NULL,
`devPos` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`region` int(1) DEFAULT NULL,
`grouping` int(1) DEFAULT NULL,
`rankPos` int(3) DEFAULT NULL,
`position` int(1) DEFAULT NULL,
`nameFirst` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`nameLast` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`feet` int(1) DEFAULT NULL,
`inches` int(2) DEFAULT NULL,
`city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`school` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`grade` int(4) DEFAULT NULL,
`wpID` int(5) DEFAULT NULL,
`wpSlug` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`level` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`pm` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
`why` text COLLATE utf8_unicode_ci,
`aau` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`pro` text COLLATE utf8_unicode_ci,
`con` text COLLATE utf8_unicode_ci,
`devClass` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
`commit` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`list` text COLLATE utf8_unicode_ci,
`colleges` text COLLATE utf8_unicode_ci,
`right` int(2) DEFAULT NULL,
`left` int(2) DEFAULT NULL,
`shotDribble` int(2) DEFAULT NULL,
`shotCatch` int(2) DEFAULT NULL,
`passing` int(2) DEFAULT NULL,
`defensePer` int(2) DEFAULT NULL,
`defensePost` int(2) DEFAULT NULL,
`rebounding` int(2) DEFAULT NULL,
`athleticism` int(2) DEFAULT NULL,
`strength` int(2) DEFAULT NULL
)




CREATE TABLE IF NOT EXISTS `wp_terms` (
`term_id` bigint(20) unsigned NOT NULL,
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`term_group` bigint(10) NOT NULL DEFAULT '0'
)

Options: ReplyQuote




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.