asp.net - Can you use MySQL @ session variables in the C# connector? -
i have query utilizes mysql session variables (note @rank variable)
select rank, userid, currentvdot ( select @rank := @rank + 1 rank, userid, maxvdot currentvdot ( select userid, max(vdot) maxvdot ( select u.userid, u.vdot ( select userid, max(created) created uservdot group userid ) g inner join uservdot u on u.userid = g.userid , u.created = g.created ) m group userid order maxvdot desc ) r, (select @rank := 0) foo ) f f.userid = @userid;
if try execute against c# mysql connector, tries tell me need declare @rank input parameter variable.
is there way around this?
thanks.
hello allison!
i facing same problem recently, found default, sql connection disables use of variables in queries. solve problem can enable connection string follows:
connection string:
server=192.168.0.0;password=root;user id=root;persist security info=true;database=my_db;allow user variables=true
you must enter connection parameter allow user variables=true make work.
i hope i've helped.
hiago takaki
Comments
Post a Comment