Launch the mysql client tool and type the following commands:
DELIMITER //
DROP PROCEDURE IF EXISTS test.read_recordByIdttx //
CREATE DEFINER=`root`@`localhost` PROCEDURE read_recordById (IN emp_id INT)
BEGIN
SELECT * FROM STUDENT WHERE ID = emp_id;
END//
DELIMITER ;
Let's examine the stored procedure in greater detail:
The first command is DELIMITER //, which is not related to the stored procedure syntax. The DELIMITER statement changes the standard delimiter which is semicolon to another. In this case, the delimiter is changed from semicolon to double-slashes. Why do we have to change the delimiter? Because we want to pass the stored procedure to the server as a whole rather than letting mysql tool interpret each statement at a time. Following the END keyword, we use the delimiter // to indicate the end of the stored procedure. The last command changes the delimiter back to the semicolon.
相关推荐
The implementation of stored procedures in MySQL 5.0 ... This book, destined to be the bible of stored procedure development, is a resource that no real MySQL programmer can afford to do without.
mysql存储过程方面的圣经,以通俗的示例方法讲述mysql存储过程的深奥内容,In MySQL Stored Procedure Programming, they put that hard-won experience to good use. Packed with code examples and covering ...
mysql stored procedure programming PDF version
存储过程(Stored Procedure)是一组为了完 成特定功能的 SQL 语句集,经编译后存储在数据库中。用户通过指定存储过程的名字并给 出参数(如果该存储过程带有参数)来执行它。存储过程是数据库中的一个重要对象,...
Using Informatica Stored Procedure Transformation
MySQL Stored Procedure Programming Advance Praise for MySQL Stored Procedure Programming Preface Objectives of This Book Structure of This Book What This Book Does Not Cover Conventions ...
学习使用存储过程(Stored Procedure),是ASP程序员的必须课之一。所有的大型数据库SPAN>都支持存储过程,比如Oracle、MS SQL等,(但MS Access不支持,不过,在Access里可以使用参数化的查询)
And also the creating process of stored procedure has no difference with that of function What’s more, the process of creating user function is also applicable to other DBMS, in which comma is the ...
sybase stored procedure
dbsclab08-Stored Procedure
A tool to generate class files to implement stored procedures创建类文件执行存储过程的工具
TERADATA SQL Reference:UDF, UDM, and External Stored Procedure Programming
Mysql Stored Procedure
一个基于ADO.NET+COBOL+Stored Procedure的程序例子代码。
SQL Server 2000 Stored Procedure Programming SQL SERVER 2000存储过程编程,英文版,pdf文件,6M左右,贼清晰
一个基于C#实现的后台运行 any stored procedure 的类库源码程序
Mysql存储过程的一本电子书,讲的还不错
Section 4 shows how to create stored procedures that provide functionality similar to procedural programming languages like PHP, Java, C++, C#, and VB. And Section 5 introduces you to database ...
简单明了的教程,快速入门,强烈推荐。也是735认证考试的材料。
including using the Zend Framework How to use MySQL to securely store your website's data How to use MySQL Workbench to manage your database Who this book is for Developers who want to harness ...