|Using TenDo | TenDo: Basic usage ||
TenDo requires queries written in valid Macro Language code.
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:
$ 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.
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.
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
$ 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.