This question is locked. New answers and comments are not allowed.
Hi All,
I wanted to execute the following query:
In runtime I got an exception:
System.ServiceModel.FaultException`1 was unhandled
Message="The query does not accept parameters, but valid params were passed for query excecution"
After this I have slightly modified the query:
I have changed the original RightAccess.Deleted = '0' condition to use parameter: RightAccess.Deleted=$2, the '0' character constant is added to the ExecuteList parameters.
With these modifications the query works fine, but I don't understand, why do I have to add this "fake" parameter? Is it a bug, or feature and I interpret something badly about the OQL syntax?!
Regards,
Peter Szintai
I wanted to execute the following query:
Query<AbRightAccess> qaccessin =
scope.GetOqlQuery<AbRightAccess>
(
"SELECT * FROM AbRightAccessExtent as RightAccess Where RightAccess.Deleted='0' and Exists User IN AbUserExtent : (User.UserId = RightAccess.UserId and User.CompId != $1 and User.Deleted = '0')"
);
IList<AbRightAccess> laccessin = qaccessin.ExecuteList(AppVars.GetLong(
"CompId"
)).ToList();
In runtime I got an exception:
System.ServiceModel.FaultException`1 was unhandled
Message="The query does not accept parameters, but valid params were passed for query excecution"
After this I have slightly modified the query:
Query<AbRightAccess> qaccessin =
scope.GetOqlQuery<AbRightAccess>
(
"SELECT * FROM AbRightAccessExtent as RightAccess Where RightAccess.Deleted=$2 and Exists User IN AbUserExtent : (User.UserId = RightAccess.UserId and User.CompId != $1 and User.Deleted = '0')"
);
IList<AbRightAccess> laccessin = qaccessin.ExecuteList(AppVars.GetLong(
"CompId"
),
'0'
).ToList();
I have changed the original RightAccess.Deleted = '0' condition to use parameter: RightAccess.Deleted=$2, the '0' character constant is added to the ExecuteList parameters.
With these modifications the query works fine, but I don't understand, why do I have to add this "fake" parameter? Is it a bug, or feature and I interpret something badly about the OQL syntax?!
Regards,
Peter Szintai