I'm moving my stored procedures to C# code. In the stored procedures I have something like
Begin
SET @Id = null;
IF ?Status = 0 THEN SET ? ?DateToday = UTC_TIMESTAMP(); END IF;
SELECT * FROM TABLE
END
In the C# Code I just copy pasted everything inside Begin and END. Like so,
MySqlCommand command = new MySqlCommand();
command.CommandText = @"SET @Id = null;
IF ?Status = 0 THEN SET ? ?DateToday = UTC_TIMESTAMP(); END IF;
SELECT * FROM TABLE"
I have an error in the If statement saying incorrect syntax. The stored procedure is working but not when I place it in C# code.