0

2か所でエラーが発生しました

CREATE PROCEDURE p2()
BEGIN  
DROP PROCEDURE IF EXISTS temp_table; // unexpected end of input
CREATE TEMPORARY TABLE temp_table (count int);
insert into temp_table select max(seq) from livefeed.TMP_LIVEFEED group by ProductID;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT minute(aa.UpdateOn) - minute(aa.TickTime), aa.* FROM livefeed.TMP_LIVEFEED aa where aa.seq in (select count from temp_table);
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
END // cross symbol error here

この場合のストアド プロシージャの正しい構文は何ですか?

4

1 に答える 1

2
delimiter //    
CREATE PROCEDURE p2()
BEGIN  
   DROP TABLE IF EXISTS temp_table;
   CREATE TEMPORARY TABLE temp_table (count int);

   insert into temp_table 
   select max(seq) 
   from livefeed.TMP_LIVEFEED 
   group by ProductID;

   SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

   SELECT minute(aa.UpdateOn) - minute(aa.TickTime), aa.* 
   FROM livefeed.TMP_LIVEFEED aa 
   where aa.seq in (select count from temp_table);

    SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
END // 
delimiter ;
于 2013-10-03T06:04:37.420 に答える