Skip to content

Creating a StoreProc Syntax Error #3

@mmTomArcher

Description

@mmTomArcher

Afternoon,

I'm trying to use DbUp to create a new Store Proc and I'm getting a syntax error when execute PerformUpgrade... My script works directly on a query window on the MySQL database.

here is the query

DROP PROCEDURE IF EXISTS My_StoreProc;

CREATE PROCEDURE My_StoreProc;(strEmail VARCHAR(255))

BEGIN
SELECT id FROM table WHERE email = strEmail
ORDER BY id DESC limit 1;
END;

Here is the error:
Script block number: 1; Message: 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 'END' at line 1
MySql.Data.MySqlClient.MySqlException (0x80004005): 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 'END' at line 1
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at DbUp.Support.ScriptExecutor.ExecuteAndLogOutput(IDbCommand command)
at DbUp.Support.ScriptExecutor.<>c__DisplayClass18_2.b__1()
at DbUp.MySql.MySqlScriptExecutor.ExecuteCommandsWithinExceptionHandler(Int32 index, SqlScript script, Action executeCommand)

Any suggestions, is there a work arround, is this a know bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Bugs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions