View Single Post
  #19 (permalink)  
Old 08-01-2007, 07:48 AM
Selena Selena is offline
D-Web Trainee
 
Join Date: Jul 2007
Location: Bangalore.
Posts: 9
Selena is on a distinguished road
Default Re: Use on group_concat

Hi murali,

I have tried your sp but have modified it as per my format of variable dec.

Here is the code,

drop procedure if exists sp_test;
create procedure sp_test()
sp_test:
begin
declare var_query text;
declare var_id integer;
SET var_query:= 'SELECT CAST(GROUP_CONCAT(mytable_id)AS BINARY) INTO var_Id FROM mytable';
prepare pre_query FROM var_query;
execute pre_query;
select var_id;
end sp_test;

I got the following Error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'var_query; execute pre_query;select var_id;end sp_test' at line 7

I have checked for my version and its
select version();
5.0.22-max-log

Could u help me what i have missed out here?
__________________
Selna.
Reply With Quote