1. 程式人生 > >存儲過程定義語法

存儲過程定義語法

mysql

DELIMITER //

DROP PROCEDURE insertData//

CREATE PROCEDURE insertData(in strData text,in tableName char(20),in medKeys text,in medValues text)

BEGIN

declare orderId int(11);

set @sql0 =strData;

prepare tem from @sql0;

execute tem;

set orderId=last_insert_id();

set @sql =kvJsonData(tableName,medKeys,medValues,orderId);

prepare tep from @sql0;

execute tep;

END

//

DELIMITER ;


存儲過程定義語法