從MySQL
PREPARE stmt_name FROM preparable_stmt;
EXECUTE stmt_name [USING @var_name [
{DEALLOCATE | DROP} PREPARE stmt_name;
通過它
同時也可以防止注入式攻擊!
為了有一個感性的認識
mysql> PREPARE stmt
mysql> SET @a =
mysql> SET @b =
mysql> EXECUTE stmt
+
| hypotenuse |
+
|
+
mysql> DEALLOCATE PREPARE stmt
mysql> SET @s =
mysql> PREPARE stmt
mysql> SET @a =
mysql> SET @b =
mysql> EXECUTE stmt
+
| hypotenuse |
+
|
+
mysql> DEALLOCATE PREPARE stmt
[
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22371.html