Computer >> Máy Tính >  >> Lập trình >> MySQL

Làm thế nào chúng ta có thể xem mã nguồn của một thủ tục lưu trữ MySQL cụ thể?


Với sự trợ giúp của câu lệnh SHOW CREATE PROCEDURE, chúng ta có thể xem mã nguồn của một thủ tục được lưu trữ. Để làm cho nó hiểu, chúng tôi đang sử dụng thủ tục được lưu trữ có tên allrecords () trong truy vấn như sau -

mysql> Show Create Procedure allrecords\G
*************************** 1. row ***************************
Procedure: allrecords
sql_mode:ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Create Procedure: CREATE DEFINERb=`root`@`localhost` PROCEDURE `allrecords`()

BEGIN
Select * from Student_info;
END

character_set_client: cp850
collation_connection: cp850_general_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.00 sec)