码迷,mamicode.com
首页 > 数据库 > 详细

存储过程中使用运行查出的SQL

时间:2014-09-30 19:16:09      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   使用   ar   sp   div   c   on   

BEGIN
 declare u_name varchar(100);
 declare s_name varchar(100);
  set u_name=‘update ‘;
 set s_name=concat(‘ set cur_status =‘,‘90‘);
 set @u_table=CONCAT(u_name,t_name,s_name);
 select @sql_info :=sql_info from sql_info where code=code_info;
 PREPARE pre_sql from @sql_info;
 PREPARE pre_u from @u_table;
 EXECUTE pre_sql;
 EXECUTE pre_u;
 deallocate prepare pre_sql;
 deallocate prepare pre_u;
 update sql_info set use_time=UNIX_TIMESTAMP(NOW()) where code=code_info;
 update calculate_data  Set  cur_status = ‘39‘ Where  item = item_code;
 
end

 

存储过程中使用运行查出的SQL

标签:style   blog   color   使用   ar   sp   div   c   on   

原文地址:http://www.cnblogs.com/img-zoom/p/4002288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!