Search code examples
mysqlsqlstored-procedurestriggerssequelpro

How can I delete a stored procedure on a table?


I have a table where I can't duplicate a row because one of the fields has a stored procedure, named items.calcPrice, on it that no longer exists.

Here's the MySQL command:

INSERT INTO items (folder_id)
VALUES (56)

the error message says, "Couldn't write row. FUNCTION items.calcPrice does not exist."

How do I identify and delete this stored procedure on my table? I have 2 fields which have a "price" value so I'm not sure which field this procedure is operating on.


Solution

  • Following our discussion in chat, it appears you have a BEFORE INSERT trigger called Items_Trigger defined on this table, which attempts to call the function to which your question refers.

    To delete the trigger:

    DROP TRIGGER Items_Trigger;