@wquery name matches multiple conditions

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

@wquery name matches multiple conditions

Postby troy_walters » Tue Jun 07, 2016 11:21 am

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.

EViews Jason
EViews Developer
Posts: 785
Joined: Tue Sep 16, 2008 3:50 pm

Re: @wquery name matches multiple conditions

Postby EViews Jason » Thu Jun 09, 2016 10:31 am

try

Code: Select all

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

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

Re: @wquery name matches multiple conditions

Postby troy_walters » Fri Jun 10, 2016 11:40 am

That did it. Thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 12 guests