日期:2014-05-16 浏览次数:20873 次
create PROCEDURE PRO_TradeToOrder ( p_channel_code varchar(10), p_date varchar(10) ) BEGIN declare tid varchar(50); DECLARE mycur CURSOR for SELECT tid FROM top_trades WHERE is_transform = 0 AND status = 'WAIT_SELLER_SEND_GOODS' AND channel_code = p_channel_code and DATE_FORMAT(created,'%Y-%m-%d') = p_date; OPEN mycur; -- REPEAT fetch mycur into tid; select CONCAT('当前的订单编号为',tid); -- end REPEAT; CLOSE mycur; END