|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Wed Feb 24, 2010 9:13 pm
%mapquery problem |
Hi,
i need search room - "This is test", "This Is test", "this Is test", etc
my alias
Code: |
<alias name="pathfind" id="1207">
<value>#var %1 {%mapquery("[Name] = '"%replace(%3,','')"' and [ZoneID] IN (SELECT ZoneID FROM ZoneTbl WHERE Name = '"%replace(%2,','')"')")}</value>
</alias> |
any idea? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Feb 24, 2010 9:34 pm |
Well, first thing I would do is use an explicit concatenation with the %concat() function, to be sure it was producing the right string. So:
Code: |
{%mapquery(%concat("Name = '",%replace(%3,',''),"' and ZoneID IN (SELECT ZoneID FROM ZoneTbl WHERE Name = '",%replace(%2,',''),"')"))} |
Other than that, can you give us a clue what your problem is? "any idea?" is a bit vague. |
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Wed Feb 24, 2010 9:55 pm |
example -
#show %mapquery(%concat([Name]='This is test'))
return 1
#show %mapquery(%concat([Name]='This is Test'))
return 2
#show %mapquery(%concat([Name]='This Is test'))
return 3
I need return: 1|2|3
pardon my vocab |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Feb 25, 2010 1:57 pm |
Ah, I see. You want to match the name ignoring upper and lower case. The easiest way to do this is to use the SQL functions LOWER() or UPPER() on both sides of the equation, like so:
Code: |
#show %mapquery(LOWER([Name])=LOWER('This is a test')) |
I just tested it and it appears to work on Cmud. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|