2013年6月22日

MySql Error: Can't update table in stored function/trigger

摘要: MySql Error: Can't update table in stored function/trigger because it is already used by statement which invoked this stored function/triggerI am running a MySQL Query. But when a new row is added from form input I get this error:Error:Can't update table 'brandnames' in stored functi 阅读全文

posted @ 2013-06-22 04:58 Step-BY-Step 阅读(2225) 评论(0) 推荐(0) 编辑

use sql trigger call java function

摘要: Use UDF sys_exec to do this.You can use thislink to use sys_exec function. It says,sys_exec sys_exec takes one command string argument and executes it. Syntaxsys_exec(arg1) Parameters and Return Valuesarg1 : A command string valid for the current operating system or execution environment. returns An 阅读全文

posted @ 2013-06-22 04:56 Step-BY-Step 阅读(1561) 评论(0) 推荐(0) 编辑

mysql语句中把string类型字段转datetime类型

摘要: mysql语句中把string类型字段转datetime类型在mysql里面利用str_to_date()把字符串转换为日期此处以表h_hotelcontext的Start_time和End_time字段为例,查询当前时间在此范围之内的数据。 www.2cto.com select * from h_hotelcontext where now() between STR_TO_DATE(Start_time,'%Y-%m-%d %H:%i:%s') and STR_TO_DATE(End_time,'%Y-%m-%d %H:%i:%s');注:'%Y- 阅读全文

posted @ 2013-06-22 03:50 Step-BY-Step 阅读(4690) 评论(0) 推荐(0) 编辑

Executing a script from Nagios event handler fails to run

摘要: I have Nagios running on a webserver. For this one Nagios service check in particular, if it fails, it will run a script. This script is triggered via Nagios event handlers.Nagios event handler command:define command{ command_name testDisableServer command_line /usr/local/nagios/... 阅读全文

posted @ 2013-06-22 01:20 Step-BY-Step 阅读(315) 评论(0) 推荐(0) 编辑

MySQL触发器如何正确使用

摘要: CREATE TRIGGER <触发器名称> <--{ BEFORE | AFTER }{ INSERT | UPDATE | DELETE }ON <表名称>FOR EACH ROW<触发器SQL语句>触发器必须有名字,最多64个字符,可能后面会附有分隔符.它和MySQL中其他对象的命名方式基本相象.这里我有个习惯:就是用表的名字+'_'+触发器类型的缩写.因此如果是表t26,触发器是在事件UPDATE(参考下面的点(2)和(3))之前(BEFORE)的,那么它的名字就是t26_bu。可以直接在EMS中创建触发器。2.触发时间:Bef 阅读全文

posted @ 2013-06-22 00:55 Step-BY-Step 阅读(496) 评论(0) 推荐(0) 编辑

导航