This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-17. For the latest, interactive version please visit https://mariadb.com/kb/.

Create Stored Procedure with vb.net

I try to create a stored procedure with vb.net and MySqlConnector. When running the script in Mariadb it runs well.

DELIMITER CREATE DEFINER=`root`@`localhost` PROCEDURE IF NOT EXISTS

Coding

END //

When I run it in vb.net, I get the following error.

MySqlConnector.MySqlException: ''DELIMITER' should not be used with MySqlConnector. See https://fl.vu/mysql-delimiter' Inner exeption MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER CREATE DEFINER=`root`@`localhos...' at line 1

I Tried also with DILIMITER $$ and without DILIMITER, but that is not exepted by Mariadb. How can I solve my error.

Answer Answered by Jos Stefens in this comment.

To solve this problem the type of the CMD can be put as text. So Delimiter is not needed.

Dim cmd As New MySqlCommand() cmd.connection = MysqlConn cmd.commandtype = CommandType.Text cmd.CommandText = Query cmd.ExecuteNonQuery()

Thx for the fast and very good explanation of mr. T.B. of Mariadb

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.