I am using Entity Framework ExecuteStoreQuery to call a MySql stored procedure with output parameter. The store procedure also returns a result set.
I get the following error.
OUT or INOUT argument 2 for routine mydb.mysp is not a variable or NEW pseudo-variable in BEFORE trigger
What is wrong? Is there a better way to call MySql sp with mix of out params and resultset?
Here is the code
var outParam = new MySqlParameter();
outParam.ParameterName = "totalRowsOut";
outParam.MySqlDbType = MySqlDbType.Int64;
outParam.Direction = ParameterDirection.Output;
var data = db.ExecuteStoreQuery<PropertySearchResultRow>
(
"call mysp(@input1, @totalRowsOut);",
new MySqlParameter("input1", 10),
outParam
);
var result = data.ToList();
int totalRowsCount = (int)outParam.Value;
Finally ended up using the ado.net MySqlCommand to call the stored proc and get the out value. Mysql and EF integration is bad.