淘先锋技术网

首页 1 2 3 4 5 6 7

执行的sql必须定义为 @sql  才能执行  否则报错

DROP PROCEDURE IF EXISTS  test_prepareStam;

delimiter //

CREATE PROCEDURE test_prepareStam(in id int)

BEGIN

TRUNCATE TABLE test_table;

INSERT INTO test_table (id, val, uv, visitor_val, visitor_uv)VALUES (111, 3,4,6,7);

INSERT INTO test_table (id, val, uv, visitor_val, visitor_uv)VALUES (112, 3,4,6,7);

select * from test_table;

END;

//

-- TRUNCATE TABLE test_table;

-- call test_prepareStam(150);

-- select * from test_table;