简体   繁体   English

SQL触发器-检查字符串

[英]SQL Trigger - Check for string

Is it possible to run a trigger whenever a new row is inserted into lets say shipping_rate , and it will check column company within that row for a certain string. 每当将新行插入让我们说(例如shipping_rate ,是否都可以运行触发器,并且它将检查该行内的列company是否有特定的字符串。 If that certain string is is there, I then want to perform an equation on column cost to change the current number. 如果存在该特定字符串,那么我想对列cost执行一个方程式以更改当前数字。 Is this feasible in MySQL? 这在MySQL中可行吗?

Yes, it is entirely possible as trigger can do essentially anything to the database that a normal query could. 是的,完全有可能,因为触发器可以对数据库执行常规查询可以做的任何事情。 You can read up on how to do that in official manual . 您可以在官方手册中阅读有关操作方法的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM