|
Tanetti Newbie
Joined: 01 Nov 2006 Posts: 8
|
Posted: Fri Jan 11, 2008 5:30 am
Mapquery - and room name variable |
I have a variable that changes based on a quest room that I need to visit, and can store that with a series of pattern matching triggers.
My problem is that some of the room names contain an apostrophe, but the SQL/Zmud combo interprets the apostrophe within the room name variable as the ending apostrophe right before the close bracket below.
#MAPQUERY {[Name] LIKE '@akroomloc'}
When the stored variable is: My room - it works fine.
When the stored variable is: Tanetti's room - it errors out.
How am I supposed to use a variable inside of the #Mapquery function, so the whole variable gets used? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jan 11, 2008 5:38 am |
You need to double the single quotes.
Code: |
#MAPQUERY {%concat("[NAME] LIKE '",%replace(@akroomloc,"'","''"),"'")} |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Tanetti Newbie
Joined: 01 Nov 2006 Posts: 8
|
Posted: Fri Jan 11, 2008 5:52 am |
it's works!!! you must be a GURU or something... oh wait, ya are! Thanks bunches!
|
|
|
|
Rtoo Beginner
Joined: 30 Jul 2009 Posts: 11
|
Posted: Fri Jul 31, 2009 4:02 pm |
I am trying to do something simular to this. I want to query the roomid (or short name). I tried using Roomid but I keep getting errors.
Any suggestions? |
|
|
|
Rtoo Beginner
Joined: 30 Jul 2009 Posts: 11
|
Posted: Thu Aug 06, 2009 5:05 pm |
Vijilante wrote: |
You need to double the single quotes.
Code: |
#MAPQUERY {%concat("[NAME] LIKE '",%replace(@akroomloc,"'","''"),"'")} |
|
This works great, but how would you add in an AND statement to narrow down the search by zone?
I have tried to add an AND statement, but I keep getting errors.
Also, there are some rooms that have (G) or [**> PK <**] and (G) [**> PK <**] at the end of the room name. This query doesn't see them, but using find on the mapper does bring them up.
So long story short, I am looking for a querry that can include room names that have (G) and/or [**> PK <**], and will only look in the current zone that I am in. |
|
|
|
|
|