Page 1 of 1

@wquery name matches multiple conditions

Posted: Tue Jun 07, 2016 11:21 am
by troy_walters
I want to wquery a database to find all object whose name matches "AUBPSF?????.a" but not "AUBPSF??000.a".

I can do this with no problem using the query functionality in the GUI, putting
name matches "aubpsf?????.a and not aubpsf??000.a"
in the WHERE field, but I need to do this programmatically.

I have tried:

Code: Select all

string tt = @wquery("acperm", "name matches "aubpsf?????.a and not aubpsf??000.a"") but this throws an error because of the nested double quotes.
I have tried:

Code: Select all

string tt = @wquery("acperm", "name matches aubpsf?????.a and not aubpsf??000.a") but this throws an error because of the ambiguity of the and operator.
Is there an escape character for strings, or am I going about this the wrong way? Thanks.

Re: @wquery name matches multiple conditions

Posted: Thu Jun 09, 2016 10:31 am
by EViews Jason
try

Code: Select all

string tt = @wquery("acperm", "name matches aubpsf?????.a and not name matches aubpsf??000.a")

Re: @wquery name matches multiple conditions

Posted: Fri Jun 10, 2016 11:40 am
by troy_walters
That did it. Thanks!