ITeye博客

mysq 存储过程判断为空null , mysql存储过程 字符串拼接

不念书的小子 · 2012-06-26 16:21 · MySql · 数据库 · Markdown

mysq 存储过程判断为空null , mysql存储过程 字符串拼接,mysq 存储过程判断为空null , mysql存储过程 字符串拼接,mysq 存储过程判断为空null , mysql存储过程 字符串拼接.

 

mysq 存储过程判断为空null 方法:

 

if i_os_type='' then
      set os_type_sql=CONCAT('=','');
   elseif i_os_type is null then
      set os_type_sql=' is null';
   else
      set os_type_sql=CONCAT('=',i_os_type);
   end if;

 

mysql存储过程 字符串拼接方法:

 

DECLARE  os_type_sql VARCHAR(100);

 if i_os_type='' then
      set os_type_sql=CONCAT('=','');
   elseif i_os_type is null then
      set os_type_sql=' is null';
   else
      set os_type_sql=CONCAT('=',i_os_type);
   end if;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。