MySQL Forums
Forum List  »  Triggers

Re: Mysql Trigger error in concatenating NEW keyword
Posted by: Peter Brawley
Date: November 15, 2015 12:47PM

You need to read about SQL, which is deliberately literal-minded, does not make such variable substitutions directly, and specifically you need to read PREPARE syntax, which would allow ...

SET @sql = "SELECT GROUP_CONCAT(CONCAT_WS('.','new',", tablename, ".", colname, ..." etc

but I think would choke on recursion like "SET @var=('SELECT...etc')", and in any event Triggers don't support PREPARE. For the kind of generality you're trying for, you need to generate the SQL with a more complete language like PHP or C#.

Edited 1 time(s). Last edit at 11/15/2015 12:49PM by Peter Brawley.

Options: ReplyQuote

Written By
Re: Mysql Trigger error in concatenating NEW keyword
November 15, 2015 12:47PM

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.