Re: Mysql Trigger error in concatenating NEW keyword
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.
Subject
Views
Written By
Posted
2061
November 15, 2015 08:15AM
Re: Mysql Trigger error in concatenating NEW keyword
994
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.