|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Oct 22, 2004 2:06 pm
Correct way to double up chars? |
Ok not sure how to explain this but but is there a better way to write this so it works without forcing expansion <> or using %char(37) in place of the % wildcard for the search.
%mapquery([NAME] LIKE '%%replace( %-1, "'", "''")%'}) //doesn't work
%mapquery([NAME] LIKE '~%%replace( %-1, "'", "''")~%'}) //doesn't work
%mapquery([NAME] LIKE '%quote(%)%replace( %-1, "'", "''")%quote(%)'})
%mapquery([NAME] LIKE '%<%replace( %-1, "'", "''")>%'}) //works but I don't want to force expansion
%mapquery([NAME] LIKE '%char(37)%replace( %-1, "'", "''")%char(37)'}) //Works but I don't want my code to get all cryptic
Im thinking the last option is prolly the only way to go....... but if there is an easier way it sure would help to know :P |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Oct 22, 2004 9:29 pm |
Off the top of my head:
%mapquery([NAME] LIKE '%{%replace( %-1, "'", "''")}%'})
%mapquery([NAME] LIKE '~%{%replace( %-1, "'", "''")}~%'}) |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Oct 22, 2004 10:40 pm |
Vijilante your last one works but gives a syntax error and since I hate those when Im trying to write a script it looks like Im stuck using the %char() method
|
|
|
|
Vodoc Apprentice
Joined: 11 Apr 2003 Posts: 119 Location: Sweden
|
Posted: Sat Oct 23, 2004 1:28 pm |
%mapquery( %concat( "[Name] LIKE '%", %replace( %-1, "'", "''"), "%'"))
Should work... |
|
|
|
|
|