This content has been marked as final. Show 9 replies
Why did you use an inline view at all? The following query returns exactly the same result as yours:
What happens when you use it instead of your statement?
I just realized what my mistake is.
Many of the individual lines in my LOV query are ending with a carriage-return character. And so, the following code line is literally concantonated with the previous line.
Once I added one or more space characters to the end of each code line, Apex accepted the query without problem.
Whew! That was tricky, indeed.
And this is why many of my other already working queries suddenly caused the error when I clcik the OK button in the LOV editor. For some reason, bringing up these already existing, working queries stripped awawy any space characters from the very end of the code codes.
I hope this helps others facing the same issue.
I just now saw your reply after posting my own "solution".
I originally did write my LOV to be as you have it. But this caused the same error. Because I did not know what was causing this, I then tried "wrapping" my UNION with a surrounding LOV. Again, the same error.
I finally posted this last incarnation in my Apex help request.
And so, I agree, your query is simpler.
In any case, as I've already mentioned, I figured out what was cauisng the error and hope others are helped by it.
I thought I had discovered why I was getting the "Invalid LOV" error (due to the lack of adequate spacing between SQL keywords in the LOV query). But I recently found that I am getting this same error for simplistic (previously working) LOV queries such as:
I'm beginning to think this is a bug in 4.1.
select ename d, empno r from emp order by 1
Has anyone else encountered this strange behavior?
Thanks for your advice.
Yes. I surrounded by LOV query with the outer SELECT. But, un-fortunately, this did not work until I embedded extra space characters after the end-of-lines in my SELECT query. Only then did trying the outer SELECT work and the LOV editor "accepted" my LOV.
But, as already mentioned above, embedding extra spaces does not work for other already existing/working LOV queries, even those quite simple in structure.