Syntax: @wquery(database, search_expression, [attribute_list])
Argument 1: database name, pattern_list
Argument 2: database query expression, search_expression
Argument 3: object attribute list, attribute_list
Return: string list
Returns a string list of object attributes for all objects in the database that satisfy the query specified by search_expression. The search_expression should be a standard database query.
By default @wquery will return the names of the objects in the database that match the search criteria. However you may specify other object attributes to be returned, by listing them (comma delimited) in attribute_list.
Examples
If a database, MYDB, contains a series object named “GDP_1” and a series called “GDP_2”, with the first being annual frequency and the second being quarterly frequency, then
@wquery("mydb", "name matches GDP* and freq=Q", "name")
returns the string “GDP_2”. Alternately,
@wquery("mydb", "name matches GDP* and freq=A", "name, freq")
returns the string list “GDP_1 A”.
@wquery("basics.edb", "freq = q and start>1970 and not scale=millions")
returns a string list of the names of all objects in the database BASICS.EDB with quarterly frequency and a start date after 1970 which do not have the custom attribute ‘scale’ set to ‘millions’.
@wunique(@wquery("mydb", "start>2000", "freq"))
returns a string list of all the frequencies of objects in the database whose start date is post 2000. Note that the @wunique function is used to remove duplicate frequencies.