atgc的博客
===========================================================
MySQL存储过程中的动态SQL
===========================================================

MySQL版本5.0.13以上

create table aa (id int);

delimiter //

create procedure test(v_sql varchar(200))
begin
set @sqltext:=concat('insert into aa ',v_sql);
prepare stmt from @sqltext;
execute stmt;

DEALLOCATE PREPARE stmt;
end;
//

call test('values (1)')//


atgc 发表于:2007.07.06 16:20 ::分类: ( 技术文章 ) ::阅读:(436次) :: 评论 (1)
re: MySQL存储过程中的动态SQL [回复]

怎么取动态SQL后的值呢

weilian 评论于: 2007.12.08 22:37

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)




切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
网站链接...