|
TrEz Newbie
Joined: 02 Aug 2006 Posts: 5
|
Posted: Sat Aug 12, 2006 7:17 am
Apostrophe problems. |
I have an alias temp:
#va path2 {%-1}
#if (@path2 = %null) {} {#va map_path %mapquery( {[Name] LIKE '%@path2%'})}
Works nice, though if I type something like "aa bb cc'dd ee", the variable is set to it, but no response from the mapquery. Is there a way to avoid this, if there's an apostrophe?
And second question... If I have a variable @temp, and a value of:
temp=aaa bb'bbb ccdd e
is there a way to remove the apostrophe, and all words surrounding it, in this case the other words to be removed would be "bb" and "bbb". Couldn't figure this one...
zMUD 7.21
Thank you.:) |
|
|
|
saet Apprentice
Joined: 12 Jun 2006 Posts: 106
|
Posted: Sat Aug 12, 2006 2:57 pm |
#VAR path2 %replace(%-1, "'", "_")
_ is a single character wildcard in SQL
Anytime I do a query I make sure to replace all apostrophes with it. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Aug 12, 2006 3:03 pm |
You can also double up the apostrophes. When SQL finds two apostrophes one after the other, it treats them as a single apostrophe.
|
|
_________________ Kjata |
|
|
|
|
|
|
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
|
|