MySQL stored procedure details mysql stored procedure and mysql stored procedure details
/* Create a stored procedure */
/* Specify an ending mark before creating a stored procedure */
DELIMITER $
CREATE PROCEDURE test_pro1()
BEGIN
SELECT * FROM
/* SQL scripts for daprototype */ Use northwind go /* Used in daprototype */ Create procedure spselcustomers ( @ customerid varchar (5) ) as select C. customerid, C. companyName, C. address, C. city from MERs C where c. customerid like @
Definition is always abstract. The stored process is actually a set of SQL statements that can perform certain operations, but these statements are stored in the database (Here we only talk about SQL Server ). If we create a stored process and call
I. MySQL Stored Procedure
First, let's talk about the creation Syntax:
CREATE PROCEDURE sp_name ([proc_parameter[,...]]) [characteristic ...] routine_body
Here is a simple example.
"Pr_add" is a simple MySQL stored procedure. This MySQL stored
View mysql stored procedure details and view mysql Stored Procedure
Stored ProcedureIn this way, we can encapsulate SQL statements that require special processing into functions. When necessary, we only need to call this function to implement the
ASP and SQL stored procedures (very detailed)
There are a lot of articles about ASP and Stored Procedures, but I doubt whether the authors have actually practiced it. I checked a large amount of relevant materials at the beginning and found that
ACID: Atomic, Consistent, Isolated, Durable
A storage program provides an excellent mechanism to define, encapsulate, and manage transactions.
1. MySQL transaction support
1) MySQL transaction support is not bound to the MySQL server itself, but
Php and mysql are a natural pair. next I will introduce how to call the mysql stored procedure and execute the returned results in php. below I will summarize some common php methods for calling the MySQL stored procedure, for more information, see.
Mysqlusetest1; ReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-ADatabasechangemysql
mysql> use test1;Reading table information for completion of table and column namesYou can turn off this
Mysql Stored Procedure syntax and instance stored procedure, such as the same programming language, also contains the data type, process control, input and output, and its own function library. -------------------- Basic syntax ------------------ 1.
A.ShowTables orShowTables from database_name; --Displays the names of all tables in the current databaseB.ShowDatabases --DisplayMySQLName of all databases inC.ShowColumns from table_name to database_name; OrShowColumns from Database_name.table_name;
Use Geovindu, #函数DELIMITER $ $drop function if exists f_getdepartmentname $ $CREATE function f_getdepartmentname (did int) Returns nvarchar (+) begindeclare str nvarchar (+); Select Departmentname into str from departmentlist where Departmenti D=did;
Connection string
The code is as follows:
String conn = configurationmanager.connectionstrings["NorthwindConnectionString"]. ConnectionString;
Confige fileThe code is as follows:
1. A stored procedure that returns only a single
stored Procedures , you can think of the SQL statement that we need special processing into a function, when needed we just call this function can achieve the operation we want, this process we can call the stored procedure. Of course, the
Stored Procedures | Detailed articles on ASP and stored procedures (Stored procedures), but I doubt if the authors actually practiced them. I have consulted a lot of relevant data at the beginning of the class, and found that many of the methods
Server| Stored Procedure | Execute Execute
A user-defined function, system procedure, user-defined stored procedure, or extended stored procedure that performs a scalar value. Also supports the execution of strings within Transact-SQL batches
To
Stored Procedure | dynamic | Web page
ASP and stored procedures (Stored procedures) article a lot, but I doubt whether the authors really practice. I have consulted a lot of relevant data at the beginning of the class, and found that many of the
Stored Procedures | tips
ASP and stored procedures (Stored procedures) article a lot, but I doubt whether the authors really practice. I have consulted a lot of relevant data at the beginning of the class, and found that many of the methods provided
A stored procedure (stored procedure) is a set of SQL statements designed to accomplish a particular function, compiled and stored in a server-side database, which can be used to accelerate the execution of SQL statements.Custom stored procedures,
Stored procedure syntax: CREATE PROCEDURE ProcedureNameBeginSQL 1end$ Show all stored procedures Show procedure status;Calling the stored procedure call procedurename (); Contains an if statement that has been saved:CREATE PROCEDURE ProcedureName (
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.