Quantcast
Channel: MySQL Forums - Install & Repo
Viewing all articles
Browse latest Browse all 7239

Triggers & Encoding (no replies)

$
0
0
Hi,

I've got a database which is set up with 'utf8_general_ci' collation. Furthermore, the collation for all tables are also set up with 'utf8_general_ci', and the same are all fields.

Now, I've set up a trigger on one of the tables to capture old data whenever an update takes place. The old data is then simply inserted into a log table.

However, whenever special characters occur, the trigger fails because a variable in the trigger is unable to handle the special character. It complains about invalid characters, and it appears to be related to the encoding. After much back and forth, I specifically set the trigger variable's encoding and things work.

My question is : what encoding does a trigger variable use by default? Is there a way to determine this without having to specifically define the encoding? It would be great if the trigger could somehow "adapt" to the encoding on the field it captures data from.

Viewing all articles
Browse latest Browse all 7239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>