mysql strored function - in varchar and return varchar - Error : 1172 -
mysql strored function - in varchar and return varchar - Error : 1172 -
hi not figure out went wrong stored function.
select batch bach test mfg_code = 'bc-7a1-5' grouping batch;
when run script above , able number of rows expected.
however not able similar script below:-
delimiter $$ drop function if exists `testdata1970_05`.`listbatch` $$ create function `listbatch`(mfgnum varchar(24)) returns varchar(10) begin declare bach varchar(10); select batch bach test mfg_code = mfgnum grouping batch; homecoming bach; end $$ delimiter ;
and returns error "error 1172 (42000): result consisted of more 1 row" , here query below
select listbatch("bc-7a1-5");
please advise. clement
your error message telling more 1 row beingness returned query, , resultset cannot stored in simple variable, variable defined can hold 1 value!
mysql
Comments
Post a Comment