• notice
  • Congratulations on the launch of the Sought Tech site

MySQL Optimization - Custom Storage Procedures and Functions

Create stored procedures and functions in MYSQL using CREATE PROCEDURE and CREATE FUNCTION respectively

Use the CALL statement to call stored procedures, and stored procedures can also call other stored procedures

Functions can be called from outside the statement and can return scalar values


Create Stored Procedure

Syntax

CREATE PROCEDURE sp_name ([ proc_parameter ]) [ characteristics..] routine_body 

proc_parameter specifies the parameter list of the stored procedure in the following form:

[IN|OUT|INOUT] param_name type

Wherein means input parameter, out means output parameter, inout means both input and output; param_name means parameter name; type means parameter type

The type can be any type in the MYSQL database

Has the following values:

characteristic:
    LANGUAGE SQL
  | [NOT] DETERMINISTIC
  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
  | SQL SECURITY { DEFINER | INVOKER }
  | COMMENT 'string'
routine_body:
    Valid SQL procedure statement or statements

LANGUAGE SQL : indicates that the routine_body part is composed of SQL statements, the language currently supported by the system is SQL, and SQL is the only value of the LANGUAGE feature

[NOT] DETERMINISTIC : Indicates whether the stored procedure executed correctly.DETERMINISTIC indicates that the result is deterministic.Every time the stored procedure is executed, the same input gets

Same output.

[NOT] DETERMINISTIC indicates that the result is indeterminate, and the same input may yield different output.If no value is specified, it defaults to [NOT] DETERMINISTIC

CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA: Indicates the limit of the SQL statement used by the subroutine.

CONTAINS SQL indicates that the subroutine contains SQL statements, but does not contain statements to read and write data;

NO SQL indicates that the subroutine does not contain SQL statements;

READS SQL DATA: indicates that the subroutine contains a statement to read data;

MODIFIES SQL DATA indicates that the subroutine contains statements that write data.

By default, CONTAINS SQL is specified

SQL SECURITY { DEFINER | INVOKER } : Indicates who has permission to execute.DEFINER means only the definer can execute

INVOKER indicates that the caller with permission can execute.By default, the system specifies DEFINER

COMMENT 'string': comment information, which can be used to describe stored procedures or functions

 

routine_body is the content of the SQL code, you can use BEGIN...END to indicate the start and end of the SQL code.

 

The following statement creates a stored procedure that queries all data in table t1

DROP PROCEDURE IF EXISTS Proc;

DELIMITER//
CREATE PROCEDURE Proc()
BEGIN
  SELECT * FROM t3;
END//
DELIMITER;

CALL Proc(); 

The t3 table is the table we created in the previous section

The logic here is

1.First judge whether there is a stored procedure of Proc(), and drop it if it exists

2.Create a Proc() stored procedure

3.Execute the Proc() stored procedure

 

Note: The function of the "DELIMITER//" statement is to set the terminator of MYSQL to//, because the default statement terminator of MYSQL is semicolon;, in order to avoid and stored procedure p>

The end character of the SQL statement conflicts, you need to use DELIMITER to change the end character of the stored procedure, and end the stored procedure with "END//".

Use DELIMITER after the stored procedure is defined; restore the default terminator.DELIMITER can also specify other symbols as terminators! ! ! ! ! ! ! ! ! ! !

 

 

If you write like this, you will get the following error, which is easy for beginners to make, including myself

CREATE PROCEDURE Proc()
BEGIN
  SELECT * FROM t3;
END

Query: CREATE PROCEDURE Proc() BEGIN SELECT * FROM t3

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.001 sec
---------------------------------------------------

Query: END

Error Code: 1064

 

Create a stored procedure named CountProc with the following code:

DELIMITER//
CREATE PROCEDURE CountProc(OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t3;
END//
DELIMITER ;

The function of the above code is to create a stored procedure to get the number of records in the t3 table, the name is CountProc,

COUNT(*) put the result into parameter param1 after calculation.

 

Note: When using the DELIMITER command, you should avoid using the backslash () character, because the backslash is a MYSQL escape character! ! !


Stored function

To create a stored function, you need to use the CREATE FUNCTION statement.The basic syntax is as follows:

CREATE FUNCTION func_name([func_parameter])
RETURNS TYPE
[characteristics...] routine_body

CREATE FUNCTION is the keyword used to create the stored function; func_name is the name of the stored function

func_parameter is the parameter list of the stored function, the parameter list is as follows

[IN|OUT|INOUT]PARAM_NAMETYPE

Among them, IN represents input parameters, OUT represents output parameters, and INOUT represents both input and output;

param_name indicates the parameter name; type indicates the parameter type, which can be any type in the MYSQL database

RETURNS TYPE statement indicates the type of data returned by the function; characteristics: specifies the characteristics of the stored function, the value is the same as when creating the stored procedure

 

Create a stored function named NameByT, which returns the query result of the SELECT statement, and the numeric type is string

DELIMITER//

CREATE FUNCTION NameByT()
RETURNS CHAR(50)
RETURN (SELECT NAME FROM t3 WHERE id=2);
//
DELIMITER ;

Note: When the RETURNS CHAR(50) data type, RETURNS has S, and RETURN (SELECT NAME FROM t3 WHERE id=2) does not have S in RETURN

So sometimes people may feel that MYSQL is annoying, and who knows if they wrote it wrong

Here is a method, which is to use the code formatting function of SQLYOG, select the code to be formatted, and then press F12.If it can be formatted, it proves that there is no problem with your code.If it cannot be formatted

Prove that there is something wrong with the code you wrote! ! !

If you don't add s, there will be a syntax error

Query: create function NameByT() return char(50) return (select name from t3 where id=2)

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return char(50)
return (select name from t3 where id=2)' at line 2

Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.003 sec
-----------------------------

Call function

SELECT nameByT()

 

AsIf the RETURN statement in a stored function returns a value of a different type than that specified in the function's RETURNS clause, the return value will be coerced to the appropriate type.

For example, if a function returns a SET or ENUM value, but the RETURN statement returns an integer, for the corresponding ENUM member of the SET member set, the value returned from the function

is a string.

Specifying parameters as IN, OUT, INOUT is only valid for PROCEDURE.

(FUNCTION always defaults to the IN parameter) The RETURNS clause specifies the FUNCTION, which is mandatory for the function.

It is used to specify the return type of the function, and the function body must contain a RETURN value statement


Use of variables

Variables can be declared and used in subprograms, and the scope of these variables is in the BEGIN...END program

1.Define variables

Define variables in stored procedures

DECLARE var_name[,varname]...date_type[DEFAULT VALUE];

var_name is the name of the local variable.The DEFAULT VALUE clause provides a default value for the variable.In addition to being declared as a constant, a value can also be specified as an expression.

If there is no DEFAULT clause, the initial value is NULL

DECLARE MYPARAM INT DEFAULT 100;

 

2.Assign values ​​to variables

After defining a variable, assigning a value to the variable can change the default value of the variable.In MYSQL, use the SET statement to assign value to the variable

SET var_name=expr[,var_name=expr]...

The SET statement in a stored procedure is an extended version of the normal SET statement.

The variable being SET may be a variable within a subroutine, or a global server variable such as a system variable or a user variable

 

He runs SET a=x,b=y,....

declare 3 variables, var1, var2 and var3

DECLARE var1,var2,var3 INT;
SET var1=10,var2=20;
SET var3=var1+var2;

MYSQL can also assign values ​​to one or more variables through SELECT...INTO

DECLARE NAME CHAR(50);
DECLARE id DECIMAL(8,2);
SELECT id,NAME INTO id ,NAME FROM t3 WHERE id=2;

Define Conditions and Handlers

Specific conditions require specific handling.These conditions can be linked to errors, as well as general flow control in subroutines.The definition condition is to define the problems encountered during the execution of the program in advance,

The handler defines what should be done when these problems are encountered, and ensures that the stored procedure or function can continue to execute in the event of a warning or error.

This can enhance the ability of the stored program to deal with problems and avoid the program to stop running abnormally

 

1.Define conditions

DECLARE condition_name CONDITION FOR[condition_type]
[condition_type]:
SQLSTATE[VALUE] sqlstate_value |mysql_error_code

condition_name: indicates the condition name

condition_type: indicates the type of condition

sqlstate_value and mysql_error_code can both indicate mysql errors

sqlstate_value is a string error code of length 5

mysql_error_code is a numeric type error code, for example: in ERROR1142(42000), the value of sqlstate_value is 42000,

The value of mysql_error_code is 1142

 

This statement specifies conditions that require special handling.It associates a name with the specified error condition.

This name is then used in the DECLARE HANDLER statement that defines the handler

 

Define ERROR1148(42000) error with name command_not_allowed.

It can be defined in two ways

//Method 1: Use sqlstate_value
DECLARE command_not_allowed CONDITION FOR SQLSTATE '42000'

//Method 2: Use mysql_error_code
DECLARE command_not_allowed CONDITION FOR SQLSTATE 1148

 

2.Define a handler

The DECLARE keyword can be used in MySQL to define handlers.Its basic syntax is as follows:

DECLARE handler_type HANDLER FOR
condition_value[,...] sp_statement
handler_type:
CONTINUE | EXIT | UNDO
condition_value:
SQLSTATE [VALUE] sqlstate_value |
condition_name | SQLWARNING
| NOT FOUND | SQLEXCEPTION | mysql_error_code 

Among them, the handler_type parameter specifies the error handling method, and this parameter has 3 values.The three values ​​are CONTINUE, EXIT and UNDO.

CONTINUE means that the error will not be processed and continue to execute downward;

EXIT means to exit immediately after encountering an error;

UNDO means to undo the previous operation after encountering an error.MySQL does not support this processing method for the time being.

Note: Under normal circumstances, if an error is encountered during execution, the execution of the following statement should be stopped immediately, and the previous operation should be withdrawn.

However, UNDO operations are not currently supported in MySQL.

Therefore, it is best to perform an EXIT operation when encountering an error.The CONTINUE operation can be performed if the error type can be predicted in advance and handled accordingly.

The

condition_value parameter indicates the error type, and this parameter has 6 values.

sqlstate_value and mysql_error_code have the same meaning as in the condition definition.

condition_name is the condition name defined by DECLARE.

SQLWARNING represents all sqlstate_value values ​​starting with 01.

NOT FOUND means all sqlstate_value values ​​starting with 02.

SQLEXCEPTION represents all sqlstate_value values ​​not captured by SQLWARNING or NOT FOUND.

sp_statement represents the execution statement of some stored procedures or functions.

The following are several ways to define handlers.The code is as follows:

//Method 1: Capture sqlstate_value
DECLARE CONTINUE HANDLER FOR SQLSTATE '42000'
SET @info='CAN NOT FIND';
//Method 2: Capture mysql_error_code
DECLARE CONTINUE HANDLER FOR 1148SET @info='CAN NOT FIND';
//Method 3: define the condition first, then call
DECLARE can_not_find CONDITION FOR 1146 ;
DECLARE CONTINUE HANDLER FOR can_not_find SET
@info='CAN NOT FIND';
//Method 4: Use SQLWARNING
DECLARE EXIT HANDLER FOR SQLWARNING SET @info='ERROR';
//Method five: use NOT FOUND
DECLARE EXIT HANDLER FOR NOT FOUND SET @info='CAN NOT FIND';
//Method six: use SQLEXCEPTION
DECLARE EXIT HANDLER FOR SQLEXCEPTION SET @info='ERROR';

The above code is 6 ways to define a handler.

The first method is to capture the sqlstate_value value.If the sqlstate_value value is 42000, the CONTINUE operation is performed, and the "CAN NOT FIND" message is output.

The second method is to capture the mysql_error_code value.If the mysql_error_code value is 1148, the CONTINUE operation is performed, and the "CAN NOT FIND" message is output.

The third way is to define the condition first, and then call the condition.Here, the can_not_find condition is first defined, and the CONTINUE operation is executed when the 1148 error is encountered.

The fourth method is to use SQLWARNING.SQLWARNING captures all sqlstate_value values ​​starting with 01, then executes the EXIT operation, and outputs "ERROR" information.

The fifth method is to use NOT FOUND.NOT FOUND captures all sqlstate_value values ​​starting with 02, then executes the EXIT operation, and outputs "CAN NOT FIND" information.

The sixth method is to use SQLEXCEPTION.SQLEXCEPTION captures all sqlstate_value values ​​that are not captured by SQLWARNING or NOT FOUND, then executes the EXIT operation, and outputs "ERROR" information

 

Define conditions and handlers

 

CREATE TABLE t8(s1 INT,PRIMARY KEY(s1))

DELIMITER//
CREATE PROCEDURE handlerdemo()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET @X2=1;
SET @X=1;
INSERT INTO t8 VALUES(1);
SET @X=2;
INSERT INTO t8 VALUES(1);
SET @X=3;
END;
//
DELIMITER;

/* call the stored procedure */
CALL handlerdemo();

/* View the result of calling the stored procedure */
SELECT @X

@X is a user variable, the execution result @X is equal to 3, which indicates that MYSQL executes to the end of the program.

If DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET @X2=1;, this row does not exist

After the second INSERT failed due to the PRIMARY KEY constraint, MYSQL may have taken an EXIT strategy and SELECT @X may have returned 2

Note: @X means user variable, use SET statement to assign value to it, user variable is related to connection, a client-defined variable cannot be used by other clients

It has a scope.When the client exits, all variables connected by the client will be automatically released

 

The variables here are no different from SQLSERVER, they are all used to store temporary values

The conditions and predefined procedures in MYSQL are actually the same as the custom errors in SQLSERVER


Cursor

MYSQL is called the cursor, SQLSERVER is called the cursor, actually the same

 

The query statement may query multiple records.Use the cursor in the stored procedure and function to read the records in the query result set one by one.

The usage of the cursor includes declaring the cursor, opening the cursor, using the cursor, and closing the cursor.Cursors must be declared before handlers, and after variables and conditions.

1.Declare cursor

The DECLARE keyword is used in MySQL to declare cursors.The basic form of its grammar is as follows:

DECLARE cursor_name CURSOR FOR select_statement ; 

Among them, the cursor_name parameter represents the name of the cursor; the select_statement parameter represents the content of the SELECT statement and returns a result set used to create the cursor

The following declares a cursor named cur_employee.The code is as follows:

DECLARE cur_employee CURSOR FOR SELECT name, age FROM employee ;

In the above example, the name of the cursor is cur_employee; the SELECT statement part is to query the values ​​of the name and age fields from the employee table.

 

2.open cursor

The OPEN keyword is used in MySQL to open the cursor.The basic form of its grammar is as follows:

OPEN cursor_name ; 

Among them, the cursor_name parameter indicates the name of the cursor.

Open a cursor named cur_employee below, the code is as follows:

OPEN cur_employee ; 

 

3.Use cursor

MySQL uses the FETCH keyword to use the cursor.The basic form of its grammar is as follows:

 

FETCH cur_employee INTO var_name[,var_name…] ; 

 

Among them, the cursor_name parameter indicates the name of the cursor; the var_name parameter indicates that the information queried by the SELECT statement in the cursor is stored in this parameter.var_name must be defined before the cursor is declared.

A cursor named cur_employee is used below.Store the queried data in the two variables emp_name and emp_age, the code is as follows:

FETCH cur_employee INTO emp_name, emp_age ; 

In the above example, the information queried by the SELECT statement in the cursor cur_employee is stored in emp_name and emp_age.emp_name and emp_age must have been previously defined.

4.Close cursor

The CLOSE keyword is used in MySQL to close the cursor.The basic form of its grammar is as follows:

 

CLOSE cursor_name ; 

 

Among them, the cursor_name parameter indicates the name of the cursor.

[Example 14-11] Next, close a cursor named cur_employee.The code is as follows:

CLOSE cur_employee ; 

In the above example, the cursor named cur_employee is closed.After it is closed, FETCH cannot be used to use the cursor.

 

Note: In MYSQL, the cursor can only be used in stored procedures and functions! !

 

So far, stored functions, stored procedures, variables, conditions, predefined procedures, and cursors are similar to SQLSERVER, but the syntax and structure are different

There will be discomfort at the beginning


Use of Process Control

Flow control can be used in stored procedures and functions to control the execution of statements.

MySQL can use IF statement, CASE statement, LOOP statement, LEAVE statement, ITERATE statement, REPEAT statement and WHILE statement to control the flow.

Each process may contain a single statement, or a compound statement using the BEGIN...END construct, and constructs can be nested

1.IF statement

IF statement is used for conditional judgment.Depending on whether the condition is met, different statements will be executed.The basic form of its grammar is as follows:

IF search_condition THEN statement_list
[ELSEIF search_condition THEN statement_list]...
[ELSE statement_list]
END IF 

Among them, the search_condition parameter represents the condition judgment statement; the statement_list parameter represents the execution statement with different conditions.

Note: MYSQL also has an IF() function, which is different from the IF statement described here

The following is an example of an IF statement.The code is as follows:

IF age>20 THEN SET @count1=@count1+1;
ELSEIF age=20 THEN SET @count2=@count2+1;
ELSE SET @count3=@count3+1;
END IF; 

This example executes different SET statements according to the size relationship between age and 20.

If the age value is greater than 20, then add 1 to the value of count1; if the age value is equal to 20, then add 1 to the value of count2;

In other cases, the value of count3 is incremented by 1.IF statements need to use END IF to end.

2.CASE statement

CASE statement is also used for conditional judgment, which can realize more complex conditional judgment than IF statement.The basic form of the CASE statement is as follows:

CASE case_value
WHEN when_value THEN statement_list
[WHEN when_value THEN statement_list]...
[ELSE statement_list]
END CASE 

Among them, the case_value parameter represents the variable for conditional judgment;

when_value parameter indicates the value of the variable;

The

statement_list parameter represents the execution statements with different when_value values.

CASE statement has another form.The syntax of this form is as follows:

CASE
WHEN search_condition THEN statement_list
[WHEN search_condition THEN statement_list]...
[ELSE statement_list]
END CASE 

Among them, the search_condition parameter represents the conditional judgment statement;

The

statement_list parameter indicates the execution statement under different conditions.

The following is an example of a CASE statement.The code is as follows:

CASE age
WHEN 20 THEN SET @count1=@count1+1;
ELSE SET @count2=@count2+1;
END CASE ; 

The code can also be in the following form:

CASE
WHEN age=20 THEN SET @count1=@count1+1;
ELSE SET @count2=@count2+1;
END CASE ; 

In this example, if the age value is 20, the value of count1 is incremented by 1; otherwise, the value of count2 is incremented by 1.CASE statements must be terminated with END CASE.

Note: The CASE statement here is slightly different from the CASE statement for the SQL CASE expression described in "Control Flow Functions".The CASE statement here cannot have an ELSE NULL clause

And use END CASE instead of END to terminate! !

 

3.LOOP statement

The LOOP statement can cause certain specific statements to be executed repeatedly to achieve a simple loop.

However, the LOOP statement itself does not have a statement to stop the loop, and the loop must be stopped by encountering a LEAVE statement, etc.

The basic form of the syntax of the LOOP statement is as follows:

[begin_label:] LOOP
statement_list
END LOOP [end_label] 

Among them, the begin_label parameter and the end_label parameter represent the signs of the start and end of the loop, respectively, these two signs must be the same, and both can be omitted;

The

statement_list parameter indicates the statement that needs to be executed in a loop.

The following is an example of a LOOP statement.The code is as follows:

add_num: LOOP
SET @count=@count+1;
END LOOP add_num ; 

This example loops and increments count by 1.Because there is no statement to jump out of the loop, the loop becomes an infinite loop.

LOOP loops all end with END LOOP.

 

4.LEAVE statement

LEAVE statement is mainly used to jump out of loop control.Its syntax is as follows:

LEAVE label 

Among them, the label parameter represents the symbol of the loop.

 

The following is an example of a LEAVE statement.The code is as follows:

add_num: LOOP
SET @count=@count+1;
IF @count=100 THEN
LEAVE add_num ;
END LOOP add_num ; 

This example loops and increments count by 1.When the value of count is equal to 100, the LEAVE statement jumps out of the loop.

 

5.ITERATE statement

The

ITERATE statement is also a statement used to break out of a loop.However, the ITERATE statement is to jump out of this loop, and then directly enter the next loop.

ITERATE statement can only appear in LOOP, REPEAT, WHILE statement.

The basic syntax of the ITERATE statement is as follows:

ITERATE label 

Among them, the label parameter represents the symbol of the loop.

The following is an example of an ITERATE statement.The code is as follows:

add_num: LOOP
SET @count=@count+1;
IF @count=100 THEN
LEAVE add_num ;
ELSE IF MOD(@count,3)=0 THEN
ITERATE add_num;
SELECT * FROM employee ;
END LOOP add_num ; 

This example loops through the operation of adding 1 to count, and ends the loop when the value of count is 100.If the value of count is divisible by 3, jump out of this loop and no longer execute the following SELECT statement.

Description: Both the LEAVE statement and the ITERATE statement are used to jump out of the loop statement, but the functions of the two are different.

LEAVE statement is to jump out of the entire loop, and then execute the program after the loop.The ITERATE statement is to jump out of this loop, and then enter the next loop.

Be sure to distinguish between these two statements.

 

6.REPEAT statement

REPEAT statement is a conditional control loop statement.When a certain condition is met, it will jump out of the loop statement.The basic grammatical form of the REPEAT statement is as follows:

[begin_label:] REPEAT
statement_list
UNTIL search_condition
END REPEAT [end_label] 

Among them, the statement_list parameter indicates the execution statement of the loop; the search_condition parameter indicates the condition for ending the loop, and the loop ends when the condition is met.

The following is an example of an ITERATE statement.The code is as follows:

REPEAT
SET @count=@count+1;
UNTIL @count=100
END REPEAT ; 

This example loops through the operation of adding 1 to count, and ends the loop when the value of count is 100.

The REPEAT loop ends with END REPEAT.

 

7.WHILE statement

The WHILE statement is also a conditional loop statement.But the WHILE statement is not the same as the REPEAT statement.

The WHILE statement is the statement inside the loop that executes when the condition is met.

The basic grammatical form of the WHILE statement is as follows:

[begin_label:] WHILE search_condition DO
statement_list
END WHILE [end_label] 

Among them, the search_condition parameter indicates the condition of the loop execution, and the loop executes when the condition is met;

The

statement_list parameter represents the execution statement of the loop.

The following is an example of an ITERATE statement.The code is as follows:

WHILE @count<100 DO
SET @count=@count+1;
END WHILE ; 

This example loops through the operation of adding 1 to count, and executes the loop when the count value is less than 100.

If the count value is equal to 100, then jump out of the loop.The WHILE loop needs to be ended with END WHILE.


Calling stored procedures and functions

Stored procedures and stored functions are collections of SQL statements stored on the server side.To use these defined stored procedures and stored functions, they must be implemented by calling

The stored procedure is called through the CALL statement.The usage of stored functions is the same as that of MySQL internal functions.

EXECUTE permission is required to execute stored procedures and stored functions

The EXECUTE privilege information is stored in the USER_PRIVILEGES table under the information_schema database

 

Calling a stored procedure

MySQL uses the CALL statement to call stored procedures.After the stored procedure is called, the database system executes the statements in the stored procedure.

Then returns the result to the output value.

The basic syntax of the CALL statement is as follows:

CALL sp_name([parameter[,…]]) ; 

Where, sp_name is the name of the stored procedure; parameter is the parameter of the stored procedure.

CALL proc()

 

 

Call a stored function

In MySQL, stored functions are used in the same way as MySQL internal functions.

In other words, user-defined stored functions are of the same nature as MySQL internal functions.

The difference is that the stored function is defined by the user, while the internal function is defined by the MySQL developer.

The following defines a stored function, and then calls the stored function.

The code is executed as follows:

--create a stored function
DELIMITER//
CREATE FUNCTION name_from_t3(id INT)
RETURNS CHAR(80)
RETURN (SELECT NAME FROM t3 WHERE id=id);
//
DELIMITER;


SELECT name_from_t3(2); 

The function of the above storage function is to query records in the t3 table according to the input id value.

Query the records whose id field value is equal to id.Then return the value of the name field of the record.


View Stored Procedures and Functions

After the stored procedure and function are created, you can view the status and definition of the stored procedure and function.

The status of stored procedures and functions can be viewed through the SHOW STATUS statement, and the definitions of stored procedures and functions can also be viewed th

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+