Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Araadan
Wanderer


Joined: 07 Jun 2009
Posts: 65

PostPosted: 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?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Araadan
Wanderer


Joined: 07 Jun 2009
Posts: 65

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net