Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP procedure IF EXISTS `uh46v_order_status_array_to_table`;
- DELIMITER $$
- USE `xhadmin_jmln3`$$
- CREATE DEFINER=`root`@`127.0.0.1` PROCEDURE `uh46v_order_status_array_to_table`(IN statuses varchar(255))
- NO SQL
- BEGIN
- DROP TEMPORARY TABLE IF EXISTS oc_order_status_tmp;
- SET @sql = CONCAT('CREATE TEMPORARY TABLE IF NOT EXISTS `oc_order_status_tmp` (
- PRIMARY KEY (`order_status_id`)
- ) ENGINE=MyISAM
- AS (SELECT `order_status_id`, `name` FROM `oc_order_status` WHERE `language_id` = 1 AND `order_status_id` in (',
- statuses, '
- ))');
- PREPARE stmt FROM @sql;
- EXECUTE stmt;
- DEALLOCATE PREPARE stmt;
- -- Usage: call uh46v_order_status_array_to_table('1,2,3,4,5');
- -- Usage: select * from oc_order_status_tmp;
- END$$
- DELIMITER ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement