Here, I want to talk about ado_browse
, the Formula Engine function to search for ADOs.
Let’s see a simple example in action:
acdba@acbox:~$ echo "ado_browse(\"symbol like 'C0.ISS%'\");" | ac_evalform -
C0.ISS.1
C0.ISS.2
C0.ISS.3
C0.ISS.4
acdba@acbox:~$
You can see that it takes a query string and returns zero or more ADO IDs that match the query.
The following table lists common usage patterns:
Query | ADOs returned |
---|---|
symbol = ‘C0.ISS.1’ | ADO with the given symbol |
symbol like ‘C0.ISS%’ | ADOs with a symbol matching the given prefix |
template = ‘C0_IN_T001_LSA’ | ADOs with the given template |
longname = ‘TERRAFINO CORP’ | ADOs with the given longname |
code = ‘ABC 123’ | ADOs with the given translation code |
attribute(‘BB_DS003_A’, now) = ‘US’ | ADOs with the current value of static attribute BB_DS003_A = US |
attribute(‘BB_DS003_A’, now) in (‘US’, ‘DE’) | ADOs with the current value of static attribute BB_DS003_A as one of US or DE |
attribute(‘BB_DS003_A’, ‘20190408:200000’) = ‘US’ | ADOs with the value of static attribute BB_DS003_A = US on or after the given point in time |
I should also not that you can use logical operators: not, and, or. And besides the =
, like
and in
seen
above, you also have <
, <=
, >=
, >
and is null
. The latter only works for explicitly stored
$NA values, which is not the same as an absent value.
Queries are executed against the underlying databases and as a consequence of this pure derived attributes cannot be used.