exec

Executes a command against an existing data source.

Purpose

This is meant for troubleshooting purposes. Some data sources (yes, MS Excel) don’t have any easy way to issue SQL statements against them and review results. exec command in CAT CLI may help you in this situation.

Usage

If you are in a directory with a single CAT project file, this is how to get data from any data source:

catcli exec --dataSource AERO_PROD --command "SELECT * FROM DIM.GATES"
or
catcli exec -d AERO_PROD -c "SELECT * FROM DIM.GATES"

CAT CLI exec

Otherwise you also need to add --project or -p to navigate CAT to your project file.

Limitations

Displaying options are very limited, basically the result of your query needs to fit into the width of your terminal window. This functionality is also in no way optimized for large amounts of data.

If you need to output more data, use Invoke-CatCommand PowerShell command. It has less limitiations, though even that is not optimized for thousands of rows. On the other hand, it can export your data to CSV and you can view them in MS Excel.