1010data queries

TenDo requires queries written in valid Macro Language code.

Copying queries from 1010data Insights Platform

If you're used to building queries in TRS or the Macro Language Workshop of 1010data Insights Platform, you can copy the code and paste it into your TenDo command. To copy the code from TRS, first build and run your query. Then click the Query tab. The Query tab displays your query in Macro Language code:

Simply copy the query code (starting with <sel) and paste it into your TenDo command. Just remember that you have to put any code you paste in quotation marks (" ") as follows:
$ tendo -u [USERNAME] pub.training_exercise_data.sales_orders_2017 "<sel value=\"(orderdate=20170201)\"/>"
Notice in the above example we had to escape the quotation marks with a backslash (\). This can be an effective technique if you just need to use a small query. Most users do a lot more than simple selection statements in their queries. If you want to use larger, more complex queries, you can save them to a query file and call the query file at the TenDo command line.
Note: Depending on the shell you're using, you may encounter other characters that must be escaped.

To save the Macro Language query as a file, copy and paste the TRS query from the Query tab into a text editor and save it as a text file.

If you write queries directly in Macro Language Workshop, you would follow the same process of copying and pasting the query into the command line or into a text editor.

Sending queries from files

TenDo accepts queries stored in text files, so you don't have to type them out each time, or even copy and paste them. Instead, you can provide TenDo with a file location as an argument, preceded by the @ symbol, as follows:

$ tendo -u [USERNAME] pub.training_exercise_data.sales_orders_2017 @queries/query.txt

Returning an entire table

If you want to return an entire table in TenDo, you can place a single dot ( . ) character in place of the query, as follows:
$ tendo -u [USERNAME] pub.training_exercise_data.sales_orders_2017 .
This command returns the entire base table, in this case pub.training_exercise_data.sales_orders_2017, in a .csv format on your terminal or command prompt screen.