The problem in my stored procedure is (I think) the command: drop trigger triggerName; where triggerName is taken literally and not as a variable. Do you have any suggestions as to how I can solve this problem?
SQLSTATE [VALUE] sqlstate_value | mysql_error_code 其中,condition_name参数表示条件的名称;condition_value参数表示条件的类型;sqlstate_value参数和mysql_error_code参数都可以表示MySQL的错误。例如ERROR 1146 (42S02)中,sqlstate_value值是42S02,mysql_error_code值是1146。 #6.下面定义"ERROR 1146 (42S02)"...
MySQL procedure drop权限问题 opsusr用户能执行drop procedure的单子;不能执行drop table的单子。 查看操作用户权限 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER on ...
In addition, if the definer of the routine has theSYSTEM_USERprivilege, the user dropping it must also have this privilege. This is enforced in MySQL 8.0.16 and later. TheIF EXISTSclause is a MySQL extension. It prevents an error from occurring if the procedure or function does not exist...
MySQL 5.0 版本开始支持存储过程。 存储过程(Stored Procedure)是一种在数据库中存储复杂程序,以便外部程序调用的一种数据库对象。 存储过程是为了完成特定功能的SQL语句集,经编译创建并保存在数据库中,用户可通过指定存储过程的名字并给定参数(需要时)来调用执行。
This statement drops the loadable function namedfunction_name. (DROP FUNCTIONis also used to drop stored functions; seeSection 15.1.29, “DROP PROCEDURE and DROP FUNCTION Statements”.) DROP FUNCTIONis the complement ofCREATE FUNCTION. It requires theDELETEprivilege for themysqlsystem schema because ...
Bug #8762 Stored Procedures: Inconsistent behavior of DROP PROCEDURE IF EXISTS statement. Submitted: 24 Feb 2005 0:32Modified: 3 Mar 2005 10:38 Reporter: Disha Email Updates: Status: Closed Impact on me: None Category: MySQL ServerSeverity: S3 (Non-critical) Version: 5.0.2OS: Linux (...
Description: Using DROP TABLE IF EXISTS in a stored procedure fails with error 1146 if the table does not exist. How to repeat: Repeat the following on using a freshly created database (called xyzzy in this example): mysql> DELIMITER // mysql> CREATE PROCEDURE pp() -> BEGIN -> -> DRO...
PL reference (MySQL mode) Syntax of PL stored programs PL stored procedures PL cursors PL conditional control statements PL data manipulation statements PL data definition statements ALTER FUNCTION ALTER PROCEDURE CREATE FUNCTION CREATE PROCEDURE CREATE TRIGGER DROP FUNCTION DROP PROCEDURE DROP TRIGGER ...
CREATE PROCEDURE droptable () BEGIN DECLARE table1 CHAR(50); SET table1 = 'xx'; DROP TABLE table1; END; But Mysql interprets table1 as the tablename, not as a variable naming a table. Is there any way to drop a table named by a variable in a stored procedure ?Navigate...