Loading data from an ODBC-compliant database

To load a table from an ODBC-compliant database, you need to provide the connection string to the ODBC data source, the full path to the new table in 1010data Insights Platform, and the query that should be run on the data.

The following is a basic TenUp query for use with an ODBC-compliant database:

$ tenup64 -u [USERNAME] -C [CONNSTR] [NEW_TABLE] [QUERY]
-C [CONNSTR]
The Connection String for the ODBC-compliant database you're extracting data from. Connection strings often contain a user name and password that are specific to your account on the ODBC-compliant database.

The most basic form of a connection string simply contains the name of the data source you're extracting from, i.e.,"DSN=[DATA_SOURCE_NAME]"

However, most connections strings contain authentication information in addition to the DSN:
"DSN=[DATA_SOURCE_NAME];
UID=[DATA_SOURCE_USER_NAME];
PWD=[DATA_SOURCE_PASSWORD]"
Note: Above is a simple connection string. Many connection strings also pass configuration information to the ODBC driver/database. If you're not sure what information must be in the connection string, contact your database administrator.
[NEW_TABLE]
This is the complete path of the new table that will be created in 1010data Insights Platform. For more information about file paths in 1010data Insights Platform, see 1010data Insights Platform file structure.

If [NEW_TABLE] begins with @, the remainder of this variable is interpreted as a path to a file containing a table tree.

If [NEW_TABLE] is a directory, TenUp generates a unique table name with the format "[USERNAME]_[SECONDS_SINCE_JANUARY_1_1970]_[TENUP_PROCESS_ID]".

[QUERY]
A query that will retrieve data from your ODBC-compliant database. The most common form of query is SQL. The simplest SQL query looks like this:
"SELECT * FROM [TABLE_NAME];"
You can either write a query yourself or acquire one from your IT department. Keep in mind, SQL databases are not the only ODBC-compliant databases. The above is used strictly as an example.

Using a query file (ODBC only)

Placing your query in the command itself is perfectly workable for small queries. However, if you want to provide a more complex query to the data source for an extract and load operation, saving the query to a file is best practice. You can call the saved query by using the @ character and the query file path, as follows:
$ tenup64 -u [USERNAME] -C [CONNSTR] [PATH_TO_NEW_TABLE] @"[PATH_TO_QUERY_FILE]"