Saving query results to the server

You can save TenDo query results to the server.

There are several ways to save the results of a 1010data query to the server with TenDo. Note that if you save or append your query results to the server, TenDo will not print or save the results to your computer. The most common way to save results to the server is to create and save a new table. In TenDo, you do this as follows:
$ tendo -u [USERNAME] [DIRECTORY].[NEW_TABLE]=[TABLE] @[QUERY]
This command will create a new table in a specified directory. The new table is made up of the data returned by your query on the base table specified.
Note: It is important to note the exact syntax of the example command above. The entire section of the command, from the directory through the base table, must not have any spaces.

The table below defines each component of the bold elements in the command example:

Table 1. Creating a New Table with TenDo
Command Component Description
[DIRECTORY]
This directory specifies the location of your new table. You must have permission to write to the directory you specify for the new table to be created.
[NEW_TABLE]
Specifies the name of the new table that will be created in the directory specified in the previous command component.
[TABLE]
Specifies the base table your query will run on.
@[QUERY]
The query you want to run on the base table. The results of this query will be saved to the new table in 1010data.

Overwriting an existing table

In addition to creating a brand new table, you can overwrite an existing table on 1010data with TenDo. The syntax is very similar to the previous example command, except to overwrite an existing table you need to use the -y switch. Here's an example:

Note: To overwrite a table you must own the table you want to overwrite.
$ tendo -u [USERNAME] [DIRECTORY].[NAMEOFEXISTINGTABLE]=[TABLE] @[QUERY] -y

This command will overwrite an existing 1010data table with the results of the query provided. If you do not use the -y switch and the name of the table you're trying to write already exists, TenDo will return an error.

Specifying table name and display information

When you create a new table or overwrite an existing table with TenDo, you can also specify the display title, short description, and long description. This is done by providing the new table's display information in parentheses immediately after the new table is specified. Here's an example:
$ tendo -u [USERNAME] [DIRECTORY].[NEW_TABLE](Query Results Table)=[TABLE] @[QUERY]
This command specifies the Title of the newly created table. To also include a Short Description and Long Description, you can include the information in the parenthesis, separated by semicolons (;). Here's an example:
$ tendo -u [USERNAME] [DIRECTORY].[NEW_TABLE]
     (Query Results Table Title;Short Desc;Long Desc)
     =[TABLE] @[QUERY]
This command will create the specified information in the table on 1010data, and that information will be visible in the 1010data web-based interface. If you want to include some information and leave other fields blank, the syntax is simple. All you have to do is provide the semicolons but leave the information out. For instance, if we did not want to include a short description in our last example, the command would look like this:
$ tendo -u [USERNAME] [DIRECTORY].[NEW_TABLE](Query Results Table Title;;Long Desc)
     =[TABLE] @[QUERY]

If you want to modify the title, short description, and/or long description of an existing table, add ! at the end of your command. Note that you must have permissions to modify the table.

In the following example, the table retail.test is modified with a new title, short description, and long description:

$ tendo -u [USERNAME] retail.test(New Title;New Short Desc;New Long Desc)!
Note: You may have to escape ! with \.