Detailed description of MySQL5.0 Stored Procedure

Source: Internet
Author: User
Tags what sql

Introduction to Introduction

The new MySQL 5.0 feature tutorial is intended for old MySQL users who need to know the new features of MySQL 5.0. Simply put, I introduced the "Stored Procedure, trigger, view, and Information Architecture View". I would like to thank the translator Chen Pengyi for his efforts.

I hope this book will be able to talk to you like an expert, so that you can learn the required knowledge with simple questions and examples. In order to achieve this purpose, I will gradually establish concepts for everyone from every detail, and finally show you a large practical example, before learning, you may think that this case is very difficult, but as long as you follow the course, I believe you will be able to master it soon.

Conventions and Styles Conventions and programming Styles

Every time I want to demonstrate the actual code, I will adjust the code displayed on the screen of the mysql client and change the font to Courier to make them look different from the normal text.

Here is an example: mysql> drop function f; Query OK, 0 rows affected (0.00 sec)

If the instance is large, you need to add comments between some rows and paragraphs. At the same time, I will place the '<--' symbol on the right side of the page to emphasize.

For example:


Mysql> create procedure p ()
-> BEGIN
->/* This procedure does nothing */<--
-> END; // Query OK, 0 rows affected (0.00 sec)


Sometimes I will remove the "mysql>" and "->" systems in the example. You can copy the Code directly to the mysql client program (if you are not reading an electronic version, you can download related scripts on the mysql.com website. Therefore, all the examples have passed the test on SUSE 9.2 Linux and Mysql 5.0.3 public edition.

When you read this book, Mysql has a higher version and supports more operating systems, including Windows, Linux, and HP-UX. So the example here will run normally on your computer. However, if the operation still fails, you can consult a senior Mysql user you know for long-term support and help.
Why MySQL Statements are Legal in a Procedure Body
What MySQL statements are valid in the Stored Procedure body?

What SQL statements are valid during Mysql storage? You can CREATE a statement that contains INSERT, UPDATE, DELETE, SELECT, DROP, CREATE, REPLACE, and so on. The only thing you need to remember is that if the Code contains the MySQL extension function, the Code cannot be transplanted. In standard SQL statements, any database definition language is legal, for example:

  • 1
  • 2
  • 3
  • Next Page
[Content navigation]
Page 1st: detailed explanation of MySQL5.0 Stored Procedure Page 2nd: detailed explanation of MySQL5.0 Stored Procedure
Page 3rd: detailed explanation of MySQL5.0 Stored Procedure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.