On 2012-12-03 7:40 AM, amit wrote:
Hi Team,

I am not able to use multi value insert via argument in mysql stored procedure, Please help where am I wrong. Thanks in Advance !

mysql> insert into input_data1 values(7777),(6666),(5555),(9999);
Query OK, 4 rows affected (0.00 sec)

*Problem*
mysql> call mobile_series1('(99889988),(12334565)');
+-----------------------+
| mobile                |
+-----------------------+
| (99889988),(12334565) |
+-----------------------+
1 row in set (0.01 sec)

instead of 2 rows in table its only one row.

*Function Code:*
|DELIMITER|
DROP  PROCEDURE  IF  EXISTS  mobile_series1;
CREATE PROCEDURE mobile_series1(IN str text) LANGUAGE SQL READS SQL DATA BEGIN DROP TABLE IF EXISTS input_data1; CREATE TEMPORARYTABLE input_data1(mobile varchar(1000)) engine=memory;
          INSERT  INTO  input_data1(mobile)  VALUES  (str);
         SELECT * FROM input_data1;
  END  |
DELIMITER;|

|Dynamic SQL requires PREPARE, see the manual page for that cmd.

PB


|
|



|

--
Best Regards
Amit Jain
www.netcore.co.in
Ext - 4109
#9833777592


Banner plane



netCORE wins GOLD in 1^st Smarties India 2012 Awards
Organized by Mobile Marketing Association (MMA)
Cross Media Integration for 'Colgate Active Salt Taste Challenge 2012' Campaign
*Campaigns nominated for other categories *
*Brand Awareness* Active Wheel Mobile Marketing Campaign *Innovation* Active Wheel Mobile Marketing Campaign




Reply via email to