有以下存儲過程: 有這個表: 調用存儲過程: 結果: ...
有以下存儲過程:
CREATE DEFINER=`root`@`localhost` PROCEDURE `P_HoverTreePages`( IN `TableName` VARCHAR(200), IN `FieldList` VARCHAR(2000) , IN `PrimaryKey` VARCHAR(100), IN `Where` VARCHAR(2000), IN `Order` VARCHAR(1000), IN `SortType` INT, IN `RecorderCount` INT, IN `PageSize` INT, IN `PageIndex` INT, OUT `TotalCount` INT, OUT `TotalPageCount` INT ) LANGUAGE SQL NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT 'fenye' BEGIN set @sqlStr = CONCAT('select * from ',TableName); prepare sqlStr from @sqlStr; execute sqlStr; END
有這個表:
調用存儲過程:
CALL `P_HoverTreePages`('t_hovertreenote', 'h', 'h', 'h', 'h', '1', '1', '2', '1', @hh, @yy)
結果: