This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am looking for an easy way to filter out results from a query. In my situation there is a table
The table contains logins of users; special users that should not be displayed in application have '!' character at the beginning of their login name (for example "!systemUser").
This solution almost works - it filters out strings with '!' at the beginning when below query is run:
but when I run query:
where 'x' is number of user, I always get the same user no matter what value of 'x' is. Can you tell me what I do wrong? Or maybe more robust approach exists to achieve described behavior? (In my case official version of LightSpeed 5 is used) Regards, Pawel |
|
|
Yes, have a look at using "query filters" instead of overriding the UnitOfWork behaviour - see http://www.mindscapehq.com/documentation/lightspeed/Performance-and-Tuning/Intercepting-Queries for more detail about this. Query filters will be applied regardless of what call ends up being used provided its not a Procedure based call or a View being used.
|
|
|
Hi, Thank you, I managed to use query interception and it works quite well - unwanted results are filtered. There is only one problem - in my case I cannot delete object. I checked how SQL is generated and it seems the problem lies there. In attachment I am enclosing database schema to show you dependencies between entities. Filter which I created looks as below, it checks if AttLogin field does not start with '!'.
User is removed in a standard way:
Generated SQL; two first operations remove dependencies, these work ok.
But when user is going to be deleted by following query:
I got an error "The multi-part identifier "t0.AttLogin" could not be bound." - due to 't0.' in generated sql. Is it a bug in Lightspeed? I tried the latest nightly build but the problem also occurs there. Regards, Pawel |
|
|
Yes this does sound like a bug - are you able to send through a repro project which triggers this query please and we can use to look into what the issue is here.
|
|
|
Hello, In attachment is a small repro project. I am sorry it took me so long but I was out of my office for the last two weeks. Regards, Pawel |
|
|
Thanks for sending through the repro project. This was indeed a bug and Ive added a fix which will be available in the next nightly build.
|
|