Detailed steps to modify MySQL stored procedures

Detailed steps to modify MySQL stored procedures

Preface

In actual development, business requirements are often modified, so it is inevitable to modify the characteristics of the stored procedure.

In MySQL, use the ALTER statement to modify the characteristics of a stored procedure

Syntax

ALTER {PROCEDURE | FUNCTION} sp_name [characteristic……]

Parameter Description

  • Sp_name, which indicates the name of the stored procedure or function
  • Characteristic, which part of the stored procedure is to be modified
  • The values ​​of Characteristic are as follows
  • CONTAINS SQL means that the subroutine contains SQL statements, but does not contain statements that read or write data.
  • NO SQL, indicating that the subroutine does not contain SQL statements
  • READS SQL DATA, indicating that the subroutine contains statements that read data
  • MODIFIES DATA, indicating that the subroutine contains statements for writing data
  • SQL SECURITY {DEFINER | INVOKER}, specifies who has permission to execute
  • DEFINER, which means that only the definer can execute it.
  • INVOKER, indicating that the caller can execute
  • COMMENT'string', indicating comment information

Modify the definition of the stored procedure CountProc1

Change the read and write permissions to MODIFIES SQL DATA and specify that the caller can execute

View modified information

Currently, MySQL does not provide code modification for existing stored procedures.

If you must modify the diam of a stored procedure, you must first delete the stored procedure and then rewrite the code or create a new stored procedure.

This is the end of this article about modifying MySQL stored procedures. For more relevant content about modifying MySQL stored procedures, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of creating, calling and managing MySQL stored procedures
  • Introduction to query commands for MySQL stored procedures
  • MySQL stored procedure in, out and inout parameter examples and summary
  • Using cursor loop to read temporary table in Mysql stored procedure
  • Mysql modify stored procedure related permissions issue
  • In-depth explanation of MySQL stored procedures (in, out, inout)
  • How to create a table by month in MySQL stored procedure
  • A brief discussion on MySql views, triggers and stored procedures
  • Detailed example of using if statement in mysql stored procedure
  • Analysis of the advantages and disadvantages of MySQL stored procedures

<<:  JS+Canvas draws a lucky draw wheel

>>:  The forgotten button tag

Recommend

Example code for CSS to achieve horizontal lines on both sides of the text

This article introduces the sample code of CSS to...

Docker meets Intellij IDEA, Java development improves productivity tenfold

Table of contents 1. Preparation before developme...

Introduction to reactive function toRef function ref function in Vue3

Table of contents Reactive Function usage: toRef ...

Getting Started Tutorial for Beginners: Domain Name Resolution and Binding

So after registering a domain name and purchasing...

Collapsed table row element bug

Let's take an example: The code is very simple...

Element dynamic routing breadcrumbs implementation example

To master: localStorage, component encapsulation ...

MySQL sorting feature details

Table of contents 1. Problem scenario 2. Cause An...

MySQL triggers: creating multiple triggers operation example analysis

This article uses an example to describe the crea...

11 Linux KDE applications you didn't know about

KDE Abbreviation for Kool Desktop Environment. A ...

Import backup between mysql database and oracle database

Import the data exported from the Oracle database...

Method of building docker private warehouse based on Harbor

Table of contents 1. Introduction to Harbor 1. Ha...