MYSQL存储过程 生手求指教!

MYSQL存储过程 新手求指教!!!
 create procedure sp3(in p1 int , in p2 int , in p3 VARCHAR,out p int)
 begin
                                                    
 if p2=0 & p3='' then
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1;
 elseif p2=0 & p3!='' then 
select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and CONCAT(b_periods,b_betCount,b_winningCount,b_amountCount,s_stype,s_sname,b_status) LIKE '%"+p3+"%';
 elseif p2!=0 & p3='' then 
    select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and lt_typeid=p2;
 elseif p2!=0 & p3!='' then 
    select count(b_id) from lottery_bet_old,lottery_strategy where b_strategyid=s_sid and b_haoma<>'[]' and b_userid=p1 and lt_typeid=p2 and CONCAT(b_periods,b_betCount,b_winningCount,b_amountCount,s_stype,s_sname,b_status) LIKE '%"+p3+"%';
 end if;
select count;
                                                      
 end

这个存储过程哪里错了??
------解决方案--------------------
1)你运行报的啥错?
2)lottery_bet_old,lottery_strategy 的表结构是啥
------解决方案--------------------
你给p3指定下长度试试in p3 VARCHAR(100);
------解决方案--------------------
我觉得也是没有指定长度的问题